greater than now

This commit is contained in:
Benjamin Takats
2022-12-19 11:45:16 +01:00
parent af91aa5498
commit 0b72899058
2 changed files with 12 additions and 1 deletions

View File

@@ -71,7 +71,7 @@ class MeetupTable extends DataTableComponent
return Meetup::query()
->whereHas('city.country', fn($query) => $query->where('code', $this->country))
->withCount([
'meetupEvents',
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
])
->orderBy('meetup_events_count', 'desc');
}

View File

@@ -350,6 +350,17 @@ class DatabaseSeeder extends Seeder
'link' => 'https://t.me/EinundzwanzigKempten',
'created_by' => 1,
]);
MeetupEvent::create([
'meetup_id' => 1,
'start' => now()
->subDays(2)
->startOfDay()
->addHours(20),
'location' => 'Einundzwanzig Kempten',
'description' => fake()->text(),
'link' => 'https://t.me/EinundzwanzigKempten',
'created_by' => 1,
]);
BitcoinEvent::create([
'venue_id' => 4,
'from' => Carbon::parse('2023-09-12')