This commit is contained in:
Adrian Hopek
2022-02-25 10:29:45 +01:00
parent 5cb46d2fc4
commit 5ded4008c7
8 changed files with 373 additions and 291 deletions

View File

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class AbsenceResource extends JsonResource
{
public static $wrap = null;
public function toArray($request): array
{
return [
"id" => $this->id,
"user" => new UserResource($this->user),
"date" => $this->date->toDisplayString(),
"cause" => $this->vacationRequest->type,
];
}
}