I’ve recently started working on some small projects that will only use the backend portion of Laravel. One of the first things we bump into is the Authentication Exception that tries to redirect to or . That redirection becomes another exception: . Here is an extreme simple solution for when you only want to work with API Responses. /home /login InvalidArgumentException: Route [login] is not defined. 1- Write a new BaseRequest By extending Laravel Request object, we can override the methods used by the framework that decides whether to give a redirect response or a JSON response to always prefer JSON. 2- Swap the implementation Inside we can find where Laravel builds the Request object. Let’s swap with our new class. public/index.php \Illumiate\Http\Request BaseRequest $response = $kernel->handle($request = \App\Http\Requests\BaseRequest:: ()); capture 3- Done! As simple as this, now any HTTP Request will be treated as it wants as the Response. No more Redirect Exceptions. application/json Update have a killer one-line middleware to achieve the same result. Check out his solution . Alexander Lichter here