1use Illuminate\Database\Eloquent\ModelNotFoundException;
2
3// Will return a ModelNotFoundException if no user with that id
4try
5{
6 $user = User::findOrFail($id);
7}
8// catch(Exception $e) catch any exception
9catch(ModelNotFoundException $e)
10{
11 dd(get_class_methods($e)); // lists all available methods for exception object
12 dd($e);
13}