I have overwritten the default user table with an existing table. When trying to register a new user i get the following error:
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must be an instance of Illuminate\Contracts\Auth\Authenticatable, instance of App\customUser given, called in {path}\vendor\laravel\framework\src\Illuminate\Foundation\Auth\RegistersUsers.php on line 35
To overwrite the default users table with my own I have made the following changes:
///Auth.php///
//Auth defaults:
'defaults' => [
'guard' => 'web',
'passwords' => 'customusers',
],
//Auth guards:
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'customusers',
],
//User providers:
'providers' => [
'customusers' => [
'driver' => 'eloquent',
'model' => App\customUser::class,
],
I don't know if these changes could cause the error I'm facing.
The error is supposedly fired in this part of 'RegisterUsers.php'
$this->guard()->login($user);
This is part of the function 'register', which looks like this:
public function register(Request $request)
{
$this->validator($request->all())->validate();
event(new Registered($user = $this->create($request->all())));
$this->guard()->login($user);
return $this->registered($request, $user)
?: redirect($this->redirectPath());
}
Any help regarding this error would be kindly appreciated, I'm fairly new to Laravel so I would like to recieve a clear explanation to my problem so I can understand why it is calling this error.
Kind regards, geertjanknapen