feat(storefront): expose event date notices
This commit is contained in:
@@ -6,6 +6,8 @@ use App\Domains\Attachable\Models\Attachment;
|
||||
use App\Domains\Attachable\Models\AttachmentCrop;
|
||||
use App\Domains\Catalog\Models\Category;
|
||||
use App\Domains\Event\Models\EventDate;
|
||||
use App\Domains\Event\Resources\EventDateChangeResource;
|
||||
use App\Domains\Event\Services\EventDateNoticeFormatter;
|
||||
use App\Domains\Menu\Models\Menu;
|
||||
use App\Domains\Tenant\Models\Tenant;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -61,6 +63,14 @@ class TenantResource extends JsonResource
|
||||
'time_start' => $eventDate->time_start,
|
||||
'time_end' => $eventDate->time_end,
|
||||
])->values(),
|
||||
'date_changes' => $this->whenLoaded(
|
||||
'eventDateChanges',
|
||||
fn () => EventDateChangeResource::collection($this->eventDateChanges)
|
||||
),
|
||||
'date_notices' => $this->whenLoaded(
|
||||
'eventDateChanges',
|
||||
fn () => app(EventDateNoticeFormatter::class)->format($this->eventDateChanges)
|
||||
),
|
||||
]),
|
||||
'extras' => $this->whenLoaded(
|
||||
'websiteExtras',
|
||||
|
||||
Reference in New Issue
Block a user