laravel eloquent has one add 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();