firstOrFail method
The first model; throws ModelNotFoundException (a 404) without one.
Implementation
Future<T> firstOrFail() async =>
(await first()) ?? (throw ModelNotFoundException(definition.morphClass));
The first model; throws ModelNotFoundException (a 404) without one.
Future<T> firstOrFail() async =>
(await first()) ?? (throw ModelNotFoundException(definition.morphClass));