title: Laravel Basic HTTP Auth Check Returning False
body: <p>I'm using the basic HTTP authentication provided in Laravel to log in to my website. However, when I call <code>Auth::Check()</code> I always get <strong>false</strong> as the response even though I am logged in.</p>
  
  <p>Does <code>Auth::Check()</code> not work with the basic authentication model and if not, is there any way to check the basic authentication to see if a user is logged in?</p>
  
  <p>This is my user class:</p>
  
  <pre><code>namespace App;
  
  use Illuminate\Foundation\Auth\User as Authenticatable;
  
  class User extends Authenticatable
  {
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'email', 'password',
      ];
  
      /**
       * The attributes excluded from the model's JSON form.
       *
       * @var array
       */
      protected $hidden = [
          'password', 'remember_token',
      ];
  
      public function getRememberToken()
      {
          return $this-&gt;remember_token;
      }
  
      public function setRememberToken($value)
      {
          $this-&gt;remember_token = $value;
      }
  
      public function getRememberTokenName()
      {
          return 'remember_token';
      }
  }
  </code></pre>
  
  <p>This is the segment of code where I set the authentication filter to use</p>
  
  <pre><code>$this-&gt;middleware('auth.basic', ['only' =&gt; ['create', 'store', 'edit', 'update', 'destroy']]);
  </code></pre>
  
  <p>And this is my <code>Auth::Check()</code> call (Always prints 0):</p>
  
  <pre><code>public function show($id)
  {
      echo \Auth::check() ? '1' : '0';
      die();
      #.......
  }
  </code></pre>
  
  <p>My routes:
  <a href="https://i.stack.imgur.com/Sbkrf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sbkrf.png" alt="Routes"></a></p>