$events = Event::whereHas('club.city', function ($q) use ($cityname) {
$query->where('name', $cityname);
})->where('accepted', 1)
->with(['club.city', 'organisation'])
->orderBy('created_at', 'asc')
->paginate(6);
assuming the city name is on the city relationship and the field is 'name'.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community