- Update API: events, users, policies, routes, resources, migrations - Remove deprecated models/resources (customers, setlists, invitations, etc.) - Refresh admin app and docs; remove apps/band Made-with: Cursor
29 lines
879 B
PHP
29 lines
879 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Resources\Api\V1;
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Resources\Json\JsonResource;
|
|
|
|
final class EventResource extends JsonResource
|
|
{
|
|
public function toArray(Request $request): array
|
|
{
|
|
return [
|
|
'id' => $this->id,
|
|
'organisation_id' => $this->organisation_id,
|
|
'name' => $this->name,
|
|
'slug' => $this->slug,
|
|
'start_date' => $this->start_date->toDateString(),
|
|
'end_date' => $this->end_date->toDateString(),
|
|
'timezone' => $this->timezone,
|
|
'status' => $this->status,
|
|
'created_at' => $this->created_at->toIso8601String(),
|
|
'updated_at' => $this->updated_at->toIso8601String(),
|
|
'organisation' => new OrganisationResource($this->whenLoaded('organisation')),
|
|
];
|
|
}
|
|
}
|