findOrFail method
Find a model by its primary key or throw an exception.
Implementation
Future<T> findOrFail(dynamic id) async {
final result = await find(id);
if (result == null) {
throw Exception('Model not found');
}
return result;
}
Find a model by its primary key or throw an exception.
Future<T> findOrFail(dynamic id) async {
final result = await find(id);
if (result == null) {
throw Exception('Model not found');
}
return result;
}