mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-01-07 06:50:15 +00:00
🌍 Scope cities, venues, and courses by country across views and refine sidebar counts accordingly
This commit is contained in:
@@ -23,10 +23,12 @@ class extends Component {
|
||||
public function with(): array
|
||||
{
|
||||
return [
|
||||
'cities' => City::with(['country', 'createdBy'])
|
||||
'cities' => City::query()
|
||||
->with(['country', 'createdBy'])
|
||||
->when($this->search, fn($query)
|
||||
=> $query->where('name', 'ilike', '%'.$this->search.'%'),
|
||||
)
|
||||
->whereHas('country', fn($query) => $query->where('countries.code', $this->country))
|
||||
->orderBy('name')
|
||||
->paginate(15),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user