feat(event): add EventDateTextFormatter for formatting event dates; update Tenant model and resource to include event_date_text; create migration for event_date_text column; enhance tests for event date formatting and tenant updates
This commit is contained in:
@@ -13,6 +13,8 @@ class EventService
|
||||
'facebook_url' => 'facebook',
|
||||
];
|
||||
|
||||
public function __construct(protected EventDateTextFormatter $eventDateTextFormatter) {}
|
||||
|
||||
public function forTenant(Tenant $tenant): Tenant
|
||||
{
|
||||
return $tenant->load(['eventDates', 'socialMedia']);
|
||||
@@ -26,6 +28,9 @@ class EventService
|
||||
$tenant->update([
|
||||
'event_title' => $data['title'],
|
||||
'event_location' => $data['location'],
|
||||
'event_date_text' => $this->eventDateTextFormatter->format(
|
||||
array_column($data['dates'], 'date')
|
||||
),
|
||||
]);
|
||||
|
||||
$this->syncDates($tenant, $data['dates']);
|
||||
|
||||
Reference in New Issue
Block a user