mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-15 12:16:47 +00:00
🌐 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:
@@ -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.'%'),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user