Files
shopit-back/app/Domains/Ticketing/Event/Resources/PublicEventResource.php

24 lines
647 B
PHP

<?php
namespace App\Domains\Ticketing\Event\Resources;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class PublicEventResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => $this->id,
'title' => $this->title,
'subtitle' => $this->subtitle,
'description' => $this->description,
'location' => $this->location,
'date_text' => $this->date_text,
'attachment_id' => $this->attachment_id,
'image' => $this->attachment?->getTemporaryUrl(1440),
];
}
}