title: How to return unauthorized using Laravel API Authentication
body: <p>I am using Laravel API authentication with a token. (as explained here:
  <a href="https://laravel.com/docs/5.8/api-authentication#protecting-routes" rel="noreferrer">https://laravel.com/docs/5.8/api-authentication#protecting-routes</a>)</p>
  
  <p>I am running some tests with Postman and it works fine. When I try to access the route without a valid token, I see that the response is the (html of the) login page of my app. How can I return a <code>Unauthorized</code> message instead of the complete login page? Do I have to create a custom middleware?</p>
  
  <p><strong>Controller</strong></p>
  
  <pre class="lang-php prettyprint-override"><code>class ExampleController extends Controller
  {
      public function __construct()
      {
          $this-&gt;middleware('auth:api');
      }
  
      public function show(Request $request) {
          return response()-&gt;json($request-&gt;user()-&gt;name);
      }
   }
  </code></pre>