laravel eloquent get results where multiple relation has data code example
Example: laravel how to query belongsTo relationship
$movies = Movie::whereHas('director', function($q) {
$q->where('name', 'great');
})->get();
$movies = Movie::whereHas('director', function($q) {
$q->where('name', 'great');
})->get();