Laravel 5.4类用户未找到

I am using laravel 5.4 i got and error that

FatalThrowableError in HasRelationships.php line 487: Class 'User' not found

In my model i am using the following code

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Auth;
use App\User;
class Review extends Model
{
 public function user()
  {
    return $this->belongsTo('User');
  }
}

Could any one help me fix this error

You should use App\User in belongsTo. If you provide only User it will look for User in the base directory. But User is in the App namespace. :

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Auth;
use App\User;
class Review extends Model
{
 public function user()
  {
    return $this->belongsTo('App\User');
  }
}

Edit :

belongsTo require a namespace of a model you can achieve it either with above mentioned method or with User::class. As it will also return the namespace of User class.

return $this->belongsTo(User::class);