toby/app/Infrastructure/Http/Resources/HolidayResource.php
Ewelina Lasowy f4d928c6ae
- UX fixes (#142)
* - changed homeoffice icon color

* - improved list of request on dashboard

* - hide holidays if no data

* - fix to holidays

* - fix

* - made forms looks better

* - hide chart when user has no vacation limit

* - linter fix

* - fix to pdf attachment for vacation request
2022-05-06 12:29:06 +02:00

25 lines
581 B
PHP

<?php
declare(strict_types=1);
namespace Toby\Infrastructure\Http\Resources;
use Illuminate\Http\Resources\Json\JsonResource;
class HolidayResource extends JsonResource
{
public static $wrap = null;
public function toArray($request): array
{
return [
"id" => $this->id,
"name" => $this->name,
"date" => $this->date->toDateString(),
"isPast" => $this->date->endOfDay()->isPast(),
"displayDate" => $this->date->toDisplayString(),
"dayOfWeek" => $this->date->dayName,
];
}
}