toby/app/Http/Resources/HolidayResource.php
2022-01-24 14:07:08 +01:00

23 lines
456 B
PHP

<?php
declare(strict_types=1);
namespace Toby\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,
"displayDate" => $this->date->toDisplayString(),
"dayOfWeek" => $this->date->dayName,
];
}
}