larabel 7 with method scope relation code example
Example: laravel scope query
$model = App\Models\Flight::where('legs', '>', 100)
->firstOr(['id', 'legs'], function () {
// ...
});
$model = App\Models\Flight::where('legs', '>', 100)
->firstOr(['id', 'legs'], function () {
// ...
});