In addition to findOrFail()
, there's also Eloquent method firstOrFail()
which will return 404 page if no records for query are found.
1$user = User::where('email', 'povilas@laraveldaily.com')->firstOrFail();
In addition to findOrFail()
, there's also Eloquent method firstOrFail()
which will return 404 page if no records for query are found.
1$user = User::where('email', 'povilas@laraveldaily.com')->firstOrFail();