mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-13 23:56:47 +00:00
🌍 Add dynamic country parameter to settings routes and enhance data relationships
- Updated settings route links to include `country` parameter dynamically resolved from session. - Improved relational queries by adding `city.country` to meetups map and `coursesEvents.course` to lecturers data.
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
<flux:menu.separator/>
|
||||
|
||||
<flux:menu.radio.group>
|
||||
<flux:menu.item :href="route_with_country('settings.profile')" icon="cog"
|
||||
<flux:menu.item :href="route('settings.profile', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])" icon="cog"
|
||||
wire:navigate>{{ __('Settings') }}</flux:menu.item>
|
||||
</flux:menu.radio.group>
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<flux:spacer/>
|
||||
|
||||
<flux:navlist variant="outline">
|
||||
<flux:navlist.item icon="language" :href="route('settings.profile')"
|
||||
<flux:navlist.item icon="language" :href="route('settings.profile', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])"
|
||||
:current="request()->routeIs('settings.profile')"
|
||||
wire:navigate>
|
||||
{{ __('Sprache wechseln') }}
|
||||
@@ -128,7 +128,7 @@
|
||||
<flux:menu.separator/>
|
||||
|
||||
<flux:menu.radio.group>
|
||||
<flux:menu.item :href="route('settings.profile')" icon="cog"
|
||||
<flux:menu.item :href="route('settings.profile', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])" icon="cog"
|
||||
wire:navigate>{{ __('Settings') }}</flux:menu.item>
|
||||
</flux:menu.radio.group>
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
<flux:menu.separator/>
|
||||
|
||||
<flux:menu.radio.group>
|
||||
<flux:menu.item :href="route('settings.profile')" icon="cog"
|
||||
<flux:menu.item :href="route('settings.profile', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])" icon="cog"
|
||||
wire:navigate>{{ __('Settings') }}</flux:menu.item>
|
||||
</flux:menu.radio.group>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<div class="flex items-start max-md:flex-col">
|
||||
<div class="me-10 w-full pb-4 md:w-[220px]">
|
||||
<flux:navlist>
|
||||
<flux:navlist.item :href="route('settings.profile')" wire:navigate>{{ __('Profile') }}</flux:navlist.item>
|
||||
<flux:navlist.item :href="route('settings.profile', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])" wire:navigate>{{ __('Profile') }}</flux:navlist.item>
|
||||
{{--<flux:navlist.item :href="route('settings.password')" wire:navigate>{{ __('Password') }}</flux:navlist.item>--}}
|
||||
<flux:navlist.item :href="route('settings.appearance')" wire:navigate>{{ __('Appearance') }}</flux:navlist.item>
|
||||
<flux:navlist.item :href="route('settings.appearance', ['country' => str(session('lang_country', 'de'))->after('-')->lower()])" wire:navigate>{{ __('Appearance') }}</flux:navlist.item>
|
||||
</flux:navlist>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -23,14 +23,17 @@ class extends Component {
|
||||
public function with(): array
|
||||
{
|
||||
return [
|
||||
'lecturers' => Lecturer::with([
|
||||
'createdBy', 'coursesEvents' => fn($query) => $query->where('from', '>=', now())->orderBy('from', 'asc')
|
||||
])
|
||||
'lecturers' => Lecturer::query()
|
||||
->with([
|
||||
'createdBy',
|
||||
'coursesEvents' => fn($query) => $query->where('from', '>=', now())->orderBy('from', 'asc'),
|
||||
'coursesEvents.course',
|
||||
])
|
||||
->withExists([
|
||||
'coursesEvents as has_future_events' => fn($query) => $query->where('from', '>=', now())
|
||||
'coursesEvents as has_future_events' => fn($query) => $query->where('from', '>=', now()),
|
||||
])
|
||||
->withCount([
|
||||
'coursesEvents as future_events_count' => fn($query) => $query->where('from', '>=', now())
|
||||
'coursesEvents as future_events_count' => fn($query) => $query->where('from', '>=', now()),
|
||||
])
|
||||
->when($this->search, fn($query)
|
||||
=> $query
|
||||
|
||||
@@ -44,7 +44,7 @@ class extends Component {
|
||||
'meetups.simplex',
|
||||
'meetups.signal',
|
||||
])
|
||||
->with(['city:id,country_id,longitude,latitude'])
|
||||
->with(['city:id,country_id,longitude,latitude', 'city.country'])
|
||||
->get()
|
||||
->map(function ($meetup) {
|
||||
$meetup->load(['meetupEvents' => function($query) {
|
||||
|
||||
@@ -107,10 +107,7 @@ Route::middleware(['auth'])
|
||||
|
||||
Volt::route('venue-create', 'venues.create')->name('venues.create');
|
||||
Volt::route('venue-edit/{venue}', 'venues.edit')->name('venues.edit');
|
||||
});
|
||||
|
||||
Route::middleware(['auth'])
|
||||
->group(function () {
|
||||
Route::redirect('settings', 'settings/profile');
|
||||
|
||||
Volt::route('settings/profile', 'settings.profile')->name('settings.profile');
|
||||
|
||||
Reference in New Issue
Block a user