mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
map for events
This commit is contained in:
@@ -25,26 +25,29 @@ class BitcoinEventTable extends Component
|
||||
{
|
||||
return view('livewire.bitcoin-event.bitcoin-event-table', [
|
||||
'markers' => BitcoinEvent::query()
|
||||
->with([
|
||||
'venue.city.country',
|
||||
])
|
||||
->whereHas('venue.city.country',
|
||||
fn($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'name' => $event->name,
|
||||
'coords' => [$event->venue->city->latitude, $event->venue->city->longitude],
|
||||
]),
|
||||
'events' => BitcoinEvent::query()
|
||||
->get()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'startDate' => $event->from,
|
||||
'endDate' => $event->to,
|
||||
'location' => $event->title,
|
||||
'description' => $event->description,
|
||||
]),
|
||||
->with([
|
||||
'venue.city.country',
|
||||
])
|
||||
->where(fn($query) => $query
|
||||
->whereHas('venue.city.country',
|
||||
fn($query) => $query->where('code', $this->country->code))
|
||||
->orWhere('show_worldwide', true)
|
||||
)
|
||||
->get()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'name' => $event->name,
|
||||
'coords' => [$event->venue->city->latitude, $event->venue->city->longitude],
|
||||
]),
|
||||
'events' => BitcoinEvent::query()
|
||||
->get()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'startDate' => $event->from,
|
||||
'endDate' => $event->to,
|
||||
'location' => $event->title,
|
||||
'description' => $event->description,
|
||||
]),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user