mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2025-12-15 00:06:48 +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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user