feat: enhance address handling with coordinates and integrate into event resources

This commit is contained in:
2026-09-30 10:59:41 -03:00
parent cfa7acabe0
commit 0693e52321
13 changed files with 282 additions and 8 deletions

View File

@@ -23,11 +23,12 @@ class PublicEventService
$query->where(function ($query) use ($term): void {
$query->where('title', 'like', '%'.$term.'%')
->orWhere('subtitle', 'like', '%'.$term.'%')
->orWhere('location', 'like', '%'.$term.'%');
->orWhereHas('address', fn ($query) => $query->where('address_text', 'like', '%'.$term.'%'))
->orWhere(fn ($query) => $query->whereNull('address_id')->where('location', 'like', '%'.$term.'%'));
});
}
return $query->with('attachment')->orderByDesc('published_at')->orderByDesc('id')->paginate(15, ['*'], 'page', $page);
return $query->with(['attachment', 'address'])->orderByDesc('published_at')->orderByDesc('id')->paginate(15, ['*'], 'page', $page);
}
public function find(Tenant $tenant, Event $event): Event
@@ -38,6 +39,7 @@ class PublicEventService
return $event->load([
'attachment',
'address',
'dates' => fn ($query) => $query->whereNull('rescheduled_to_event_date_id')->whereNull('suspended_at'),
'socialMedia',
'catalogItems.attachments',