mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
->when($this->country
This commit is contained in:
@@ -69,13 +69,13 @@ class MeetupTable extends DataTableComponent
|
|||||||
public function builder(): Builder
|
public function builder(): Builder
|
||||||
{
|
{
|
||||||
return Meetup::query()
|
return Meetup::query()
|
||||||
|
->when($this->country, fn($query, $country) => $query->whereHas('city.country',
|
||||||
|
fn($query) => $query->where('code', $this->country)))
|
||||||
->with([
|
->with([
|
||||||
'users',
|
'users',
|
||||||
'city.country',
|
'city.country',
|
||||||
'meetupEvents',
|
'meetupEvents',
|
||||||
])
|
])
|
||||||
->when($this->country, fn($query, $country) => $query->whereHas('city.country',
|
|
||||||
fn($query) => $query->where('code', $this->country)))
|
|
||||||
->withCount([
|
->withCount([
|
||||||
'users',
|
'users',
|
||||||
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
|
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
|
||||||
|
|||||||
Reference in New Issue
Block a user