title: Laravel 5.1 Class '\App\User' not found, FatalErrorException in EloquentUserProvider.php line 126
body: <p>I moved my <code>User</code> Model from <code>App\User</code> to <code>App\Models\Users</code>, I followed the proper instruction, the same thing working properly on Windows OS, while facing error on <code>Ubuntu 14.04</code></p>
  
  <p>Whenever I try to <code>Login(When submit information)</code> it gives me error </p>
  
  <blockquote>
    <p>FatalErrorException in
    /var/www/html/sms/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php</p>
    
    <p>line 126: Class '\App\User' not found</p>
  </blockquote>
  
  <p>I also run <code>composer dump-autoload</code> command, but no luck. 
  Also tried this </p>
  
  <p><a href="https://stackoverflow.com/a/28516582/1216451">https://stackoverflow.com/a/28516582/1216451</a></p>
  
  <p>Here is my settings for <code>Models</code> directory</p>
  
  <p><strong>composer.json</strong></p>
  
  <pre><code>"autoload": {
      "classmap": [
          "database",
          "app/Models"
      ],
      "psr-4": {
          "App\\": "app/"
      }
  },
  </code></pre>
  
  <p><strong>Model Directory Structure</strong>
  <code>App/Models/</code></p>
  
  <p><strong>Model</strong> <code>User.php</code></p>
  
  <pre><code>namespace App\Models;
  </code></pre>
  
  <p><strong>Auth.php</strong> tried both lines, given below.</p>
  
  <pre><code>'model' =&gt; App\Models\User::class,
  'model' =&gt; App\Models\User,
  </code></pre>
  
  <p><strong>AuthController.php</strong></p>
  
  <pre><code>use App\Models\User;
  </code></pre>
  
  <p><strong>EloquentUserProvider.php</strong> path is <code>sms/vendor/laravel/framework/src/Illuminate/Auth/EloquentUserProvider.php line 126</code></p>
  
  <pre><code>public function createModel()
  {
      $class = '\\'.ltrim($this-&gt;model, '\\');
  
      return new $class; //line# 126
  }
  </code></pre>