$user = User::findOrFail($id);
$user = DB::table('users') ->where('name', $name) ->select('name', 'email') ->findOrFail();In this example, we are using the Query Builder to find a user with a specific $name. If the user doesn't exist, a ModelNotFoundException exception will be thrown. The findOrFail method is usually used in laravel framework and is defined inside the Illuminate\Database\Eloquent\Model class. Hence, the package library is laravel eloquent.