$user = User::findOrFail($id);
$order = Order::where('status', 'paid')->findOrFail($id);In this example, we are trying to find an order that has been paid and has a specific ID. If the order is not found, Laravel will again throw a ModelNotFoundException. The findOrFail method is part of the Illuminate\Database\Eloquent\Builder class, which is a Laravel package and library.