title: How to use token authentication in laravel web page
body: <p>I am trying to use JWT for laravel web page instead of session. so I made some changes.</p>
  
  <ol>
  <li><p>Installed <a href="https://github.com/tymondesigns/jwt-auth" rel="noreferrer">jwt-auth</a> and <a href="https://github.com/tymondesigns/jwt-auth/wiki/Installation" rel="noreferrer">configure</a></p></li>
  <li><p>Then changed default guard as <code>api</code> in config/auth.php</p>
  
  <pre><code>'defaults' =&gt; [
      'guard' =&gt; 'api',
      'passwords' =&gt; 'users',
  ],
  
  'guards' =&gt; [
      ...
  
      'api' =&gt; [
          'driver' =&gt; 'token',
          'provider' =&gt; 'users',
      ],
  ],
  </code></pre></li>
  </ol>
  
  <p>Now I am getting error </p>
  
  <blockquote>
    <p>(1/1) FatalErrorException Call to undefined method
    Illuminate\Auth\TokenGuard::attempt() in AuthenticatesUsers.php (line
    75)</p>
  </blockquote>
  
  <p>How to fix this and start token authentication for laravel web page(blades not API).</p>