mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
all meetups
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Http\Livewire\Meetup;
|
||||
|
||||
use App\Models\Country;
|
||||
use App\Models\Meetup;
|
||||
use App\Models\MeetupEvent;
|
||||
use Livewire\Component;
|
||||
use RalphJSmit\Laravel\SEO\Support\SEOData;
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use Rappasoft\LaravelLivewireTables\Views\Filters\TextFilter;
|
||||
|
||||
class MeetupTable extends DataTableComponent
|
||||
{
|
||||
public string $country;
|
||||
public ?string $country = null;
|
||||
|
||||
protected $model = Meetup::class;
|
||||
|
||||
@@ -69,7 +69,8 @@ class MeetupTable extends DataTableComponent
|
||||
public function builder(): Builder
|
||||
{
|
||||
return Meetup::query()
|
||||
->whereHas('city.country', fn($query) => $query->where('code', $this->country))
|
||||
->when($this->country, fn($query, $country) => $query->whereHas('city.country',
|
||||
fn($query) => $query->where('code', $this->country)))
|
||||
->withCount([
|
||||
'users',
|
||||
'meetupEvents' => fn($query) => $query->where('start', '>=', now()),
|
||||
|
||||
Reference in New Issue
Block a user