findOrFail method

Future<T> findOrFail(
  1. dynamic id
)
inherited

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;
}