For example, I use:
return User::findOrFail($id);
When row does not exist with $id
I get exception.
How I can return this exception in Json response? It returns HTML Laravel page now.
I need something like as:
{"error", "No query results for model"}