🌐 Add 'all-meetups' route and update sidebar to include global meetup view

- Introduced `all-meetups` route (`meetups.index-all`) for accessing meetups globally.
- Updated sidebar with a new navigation item for global meetups, including icon and dynamic badge count.
- Enhanced backend logic to handle country-specific and global meetup filtering based on the current route.
This commit is contained in:
HolgerHatGarKeineNode
2025-11-24 02:45:13 +01:00
parent ac720a0753
commit ae7479eac0
9 changed files with 44 additions and 13 deletions

View File

@@ -14,9 +14,11 @@ class extends Component {
public $country = 'de';
public $search = '';
public string $currentRouteName = '';
public function mount(): void
{
$this->currentRouteName = request()->route()->getName();
$this->country = request()->route('country', config('app.domain_country'));
}
@@ -34,7 +36,9 @@ class extends Component {
})
->selectRaw('meetups.*, MIN(meetup_events.start) as next_event_start')
->groupBy('meetups.id')
->whereHas('city.country', fn($query) => $query->where('countries.code', $this->country))
->when($this->currentRouteName === 'meetups.index', fn($query) =>
$query->whereHas('city.country', fn($query) => $query->where('countries.code', $this->country))
)
->when($this->search, fn($query)
=> $query->where('meetups.name', 'ilike', '%'.$this->search.'%'),
)