title: User Authentication in Lumen
body: <p>I'm trying to enable basic user authentication <code>username</code>, and <code>password</code> into my Lumen application. </p>
  
  <p>In <code>app.php</code> file, the following has been uncommented as explained in <a href="https://lumen.laravel.com/docs/5.4/authentication" rel="nofollow noreferrer">https://lumen.laravel.com/docs/5.4/authentication</a></p>
  
  <pre><code> $app-&gt;withFacades();
   $app-&gt;routeMiddleware([
      'auth' =&gt; App\Http\Middleware\Authenticate::class,
   ]);
    $app-&gt;register(App\Providers\AuthServiceProvider::class);
  </code></pre>
  
  <p>My Route looks like this:</p>
  
  <pre><code> $app-&gt;post('auth/register', ['uses' =&gt; 'Auth\AuthController@postRegister']);
  </code></pre>
  
  <p>My Controller looks like this:</p>
  
  <pre><code>namespace App\Http\Controllers\Auth;
  
  use App\Http\Controllers\Controller;
  use App\Repositories\UserRepository;
  use Illuminate\Http\Request;
  use Auth;
  use App\User;
   class AuthController extends Controller {
  
  /**
   * Create a new authentication controller instance.
   *
   * @return void
   */
  public function __construct()
  {
  
  }
  
  public function postRegister(Request $request, UserRepository $userRepository)
  {
      $this-&gt;validate($request, [
          'name' =&gt; 'required|max:255',
          'email' =&gt; 'required|email|max:255|unique:users',
          'password' =&gt; 'required|confirmed|min:6',
      ]);
  
      $user = $userRepository-&gt;store($request);
  
      Auth::login($user);
  
      return ['result' =&gt; 'success'];
  }
  }
  </code></pre>
  
  <p>I have been getting a combination of weird and wonderful errors, currently I'm getting: </p>
  
  <pre><code>ReflectionException in BoundMethod.php line 155:
  Class App\Repositories\UserRepository does not exist
  </code></pre>
  
  <p>I've done some extensive google searching, but there doesn't seem to be many documented uses of user auth in Lumen so looking for a pointer as to what I've missed here. </p>