laravel builder methods code example
Example 1: laravel query builder select first
$user = DB::table('users')->where('name', 'John')->first();
var_dump($user->name);
Example 2: laravel find query
$model = App\Models\Flight::where('legs', '>', 100)->firstOr(function () {
// ...
});