title: Laravel version 5.4 Class '\App\User::class' not found
body: <p>Specific error : </p>
  
  <p><code>Class '\App\User::class' not found (View: C:\xampp\htdocs\contrex\resources\views\login.blade.php</code>)</p>
  
  <p>I know this problem has been posted many times but i really can't find the solution.</p>
  
  <p>I tried to create a directory "Models" so i can have all my models there. Before doing that it was working just fine so i tried to change the settings back to where it was - but now it doesn't work.</p>
  
  <blockquote>
    <p>My User.php </p>
  </blockquote>
  
  <pre><code>&lt;?php
  
  namespace App;
  namespace Illuminate\Foundation\Auth;
  
  use Illuminate\Database\Eloquent\Model;
  use Illuminate\Auth\Authenticatable;
  use Illuminate\Auth\Passwords\CanResetPassword;
  use Illuminate\Foundation\Auth\Access\Authorizable;
  use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
  use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
  use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
  use Illuminate\Notifications\Notifiable;
  
  class User extends Model implements
      AuthenticatableContract,
      AuthorizableContract,
      CanResetPasswordContract
  {
      use Authenticatable, Authorizable, CanResetPassword;
  
      use Notifiable;
  
      /**
       * The attributes that are mass assignable.
       *
       * @var array
       */
      protected $fillable = [
          'name', 'email', 'facebook_id',
      ];
  
      /**
       * The attributes that should be hidden for arrays.
       *
       * @var array
       */
      protected $hidden = [
          'remember_token',
      ];
  
  
  }
  </code></pre>
  
  <blockquote>
    <p>My UserController.php</p>
  </blockquote>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use App\User;
  
  use Illuminate\Http\Request;
  
  class UserController extends Controller
  {
      public function index(){
          echo 'index';
      }
      public function create(){
          echo 'create';
      }
      public function store(Request $request){
          echo 'store';
      }
      public function show(){
      }
      public function edit($id){
          echo 'edit';
      }
      public function update(Request $request, $id){
          echo 'update';
      }
      public function destroy($id){
          echo 'destroy';
      }
  
  }
  </code></pre>
  
  <blockquote>
    <p>My SocialAuthController.php</p>
  </blockquote>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  use App\User;
  use Illuminate\Support\Facades\Auth;
  use Laravel\Socialite\Facades\Socialite;
  
  class SocialAuthController extends Controller
  {
      public function redirect()
      {
          return Socialite::driver('facebook')-&gt;with(['auth_type' =&gt; 'rerequest'])-&gt;redirect();
      }
  
      public function callback()
      {
          try {
              $user = Socialite::driver('facebook')-&gt;user();
          } catch (Exception $e) {
              return redirect('auth/facebook');
          }
  
          if($user-&gt;email == null)
              return Socialite::driver('facebook')-&gt;with(['auth_type' =&gt; 'rerequest'])-&gt;redirect();
  
          $authUser = $this-&gt;findOrCreateUser($user);
  
          Auth::login($authUser, true);
  
          return redirect()-&gt;route('login');
      }
  
      private function findOrCreateUser($facebookUser)
      {
  
          $authUser = User::where('facebook_id', $facebookUser-&gt;id)-&gt;first();
  
          if ($authUser){
              return $authUser;
          }
  
          return User::create([
              'name' =&gt; $facebookUser-&gt;name,
              'email' =&gt; $facebookUser-&gt;email,
              'facebook_id' =&gt; $facebookUser-&gt;id,
          ]);
      }
  
  }
  </code></pre>
  
  <blockquote>
    <p>Settings on auth.php</p>
  </blockquote>
  
  <pre><code> 'providers' =&gt; [
          'users' =&gt; [
              'driver' =&gt; 'eloquent',
              'model' =&gt; 'App\User::class',
          ],
  </code></pre>
  
  <blockquote>
    <p>Settings on composer.json</p>
  </blockquote>
  
  <pre><code> "autoload": {
          "classmap": [
              "database"
          ],
          "psr-4": {
              "App\\": "app/"
          }
      },
  </code></pre>
  
  <p>I tried different things - also running <code>php artisan config:clear</code> etc.</p>
  
  <p>Any ideas? </p>