Found solution: have changed "with" to "whereHas", and now it works!
Doctor::whereHas('clinics', function($query){
$query->where('clinics.top', true);
}])
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community