mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
add visible_on_map field to meetups table
This commit is contained in:
@@ -22,7 +22,7 @@ class MeetupEventTable extends Component
|
||||
|
||||
public function mount()
|
||||
{
|
||||
if (! $this->year) {
|
||||
if (!$this->year) {
|
||||
$this->year = now()->year;
|
||||
}
|
||||
}
|
||||
@@ -31,33 +31,34 @@ class MeetupEventTable extends Component
|
||||
{
|
||||
return view('livewire.meetup.meetup-event-table', [
|
||||
'markers' => MeetupEvent::query()
|
||||
->with([
|
||||
'meetup.city.country',
|
||||
])
|
||||
->where('meetup_events.start', '>=', now()->subDay())
|
||||
->whereHas('meetup.city.country',
|
||||
fn ($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn ($event) => [
|
||||
'id' => $event->id,
|
||||
'name' => $event->meetup->name.': '.$event->location,
|
||||
'coords' => [$event->meetup->city->latitude, $event->meetup->city->longitude],
|
||||
]),
|
||||
->where('visible_on_map', true)
|
||||
->with([
|
||||
'meetup.city.country',
|
||||
])
|
||||
->where('meetup_events.start', '>=', now()->subDay())
|
||||
->whereHas('meetup.city.country',
|
||||
fn($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'name' => $event->meetup->name . ': ' . $event->location,
|
||||
'coords' => [$event->meetup->city->latitude, $event->meetup->city->longitude],
|
||||
]),
|
||||
'events' => MeetupEvent::query()
|
||||
->with([
|
||||
'meetup.city.country',
|
||||
])
|
||||
->where('meetup_events.start', '>=', now()->subDay())
|
||||
->whereHas('meetup.city.country',
|
||||
fn ($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn ($event) => [
|
||||
'id' => $event->id,
|
||||
'startDate' => $event->start,
|
||||
'endDate' => $event->start->addHours(1),
|
||||
'location' => $event->location,
|
||||
'description' => $event->description,
|
||||
]),
|
||||
->with([
|
||||
'meetup.city.country',
|
||||
])
|
||||
->where('meetup_events.start', '>=', now()->subDay())
|
||||
->whereHas('meetup.city.country',
|
||||
fn($query) => $query->where('countries.code', $this->country->code))
|
||||
->get()
|
||||
->map(fn($event) => [
|
||||
'id' => $event->id,
|
||||
'startDate' => $event->start,
|
||||
'endDate' => $event->start->addHours(1),
|
||||
'location' => $event->location,
|
||||
'description' => $event->description,
|
||||
]),
|
||||
])->layout('layouts.app', [
|
||||
'SEOData' => new SEOData(
|
||||
title: __('Meetup dates'),
|
||||
|
||||
Reference in New Issue
Block a user