Laravel authentication confusing Laravel authentication confusing laravel laravel

Laravel authentication confusing


You, should implement Illuminate\Contracts\Auth\Authenticatable in users Model class to pass through Auth::login

Authenticate A User Instance

If you need to log an existing user instance into your application, you may call the login method with the user instance. The given object must be an implementation of the Illuminate\Contracts\Auth\Authenticatable contract. Of course, the App\User model included with Laravel already implements this interface:

Auth::login($user);

https://laravel.com/docs/5.1/authentication

Or you can simply do this:

Auth::loginUsingId(1);