🌍 Scope cities, venues, and courses by country across views and refine sidebar counts accordingly

This commit is contained in:
HolgerHatGarKeineNode
2025-12-05 19:06:55 +01:00
parent c9971144da
commit 0b6853a6ff
3 changed files with 6 additions and 4 deletions

View File

@@ -93,13 +93,13 @@
<flux:navlist.item icon="building-office-2" :href="route_with_country('cities.index')"
:current="request()->routeIs('cities.index')"
wire:navigate
badge="{{ \App\Models\City::query()->count() }}">
badge="{{ \App\Models\City::query()->whereHas('country', fn($query) => $query->where('countries.code', request()->route('country')))->count() }}">
{{ __('Städte/Gebiete') }}
</flux:navlist.item>
<flux:navlist.item icon="map-pin" :href="route_with_country('venues.index')"
:current="request()->routeIs('venues.index')"
wire:navigate
badge="{{ \App\Models\Venue::query()->count() }}">
badge="{{ \App\Models\Venue::query()->whereHas('city.country', fn($query) => $query->where('countries.code', request()->route('country')))->count() }}">
{{ __('Veranstaltungsorte') }}
</flux:navlist.item>
</flux:navlist.group>