toby/app/Infrastructure/Http/Resources/VacationRequestResource.php
Adrian Hopek a0e60a3160
#74 - vacation calendar (#87)
* - polishing calendar

* wip

* wip

* #74 - wip

* #74 - wip

* #74 - wip

* #74 - fix icons

Co-authored-by: EwelinaLasowy <ewelina.lasowy@blumilk.pl>
2022-03-21 11:57:32 +01:00

28 lines
709 B
PHP

<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class VacationRequestResource extends JsonResource
{
public static $wrap = null;
public function toArray($request): array
{
return [
"id" => $this->id,
"name" => $this->name,
"user" => new UserResource($this->user),
"type" => $this->type,
"state" => $this->state,
"from" => $this->from->toDisplayString(),
"to" => $this->to->toDisplayString(),
"comment" => $this->comment,
"days" => VacationResource::collection($this->vacations),
];
}
}