title: Lumen HTTP Basic Authentication
body: <p>I am trying to use Laravel's HTTP Basic Authentication in a Lumen project.</p>
  
  <p>On the <code>routes.php</code> file, I set the auth.basic middleware for the rout I need to authenticate:</p>
  
  <pre><code>$app-&gt;get('/test', ['middleware' =&gt; 'auth.basic', function() {
      return "test stuff";
  }]);
  </code></pre>
  
  <p>On <code>bootstrap.php</code> I have registered the middleware and the auth service provider:</p>
  
  <pre><code>$app-&gt;routeMiddleware([
      'auth.basic' =&gt;  Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
  ]);
  </code></pre>
  
  <p>[...]</p>
  
  <pre><code>$app-&gt;register(App\Providers\AuthServiceProvider::class);
  </code></pre>
  
  <p>But when I try to test the route by visiting <code>http://lumen/test</code> I get the following error:</p>
  
  <p><code>Fatal error: Call to undefined method Illuminate\Auth\RequestGuard::basic() in C:\source\lumen\vendor\illuminate\auth\Middleware\AuthenticateWithBasicAuth.php on line 38</code></p>
  
  <p>Does anyone know how can I get the code of the guard for basic authentication?</p>
  
  <p>Thanks.</p>