Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given,

Use laravel's built-in registration authentication system to register an account, and the following error is prompted. After Google, I found an answer on github and solved it. share

Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\User given,

 

As follows, modify your User model

use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model; use Illuminate\Auth\Authenticatable as AuthenticableTrait; class User extends Model implements Authenticatable { use AuthenticableTrait;

  

Reference: https://github.com/jenssegers/laravel-mongodb/issues/702

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325319340&siteId=291194637