Answer the question
In order to leave comments, you need to log in
How to fix an authentication error?
One line of code from the documentation:\Auth::login(1,true);
Throws an error:
FatalThrowableError in SessionGuard.php line 439:
Type error: Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, integer given
Answer the question
In order to leave comments, you need to log in
You are trying to login with ID.
Accordingly, there is a method for it:
Auth::loginUsingId(1);
Authenticate A User By ID
To log a user into the application by their ID, you may use the loginUsingId method. This method accepts the primary key of the user you wish to authenticate:
Auth::loginUsingId(1);
// Login and "remember" the given user...
Auth::loginUsingId(1, true);
https://laravel.com/docs/5.6/authentication
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question