How do we access an attribute called name that is part of the model Author? Author::first() Laravel code example
Example 1: find or fail laravel
$model = App\Models\Flight::findOrFail(1);
$model = App\Models\Flight::where('legs', '>', 100)->firstOrFail();
Example 2: laravel find query
foreach (Flight::where('foo', 'bar')->cursor() as $flight) {
//
}