I'm currently building an application which has different types of users. I want to create these user types and be able to authenticate them.
I copied the User class and made
class Owner extends Authenticatable
{
protected $fillable = [ 'name', 'email', 'pass'];
}
then in my controller
// Register Owner
$owner = Owner::create([
'name' => request('name'),
'email' => request('email'),
'password' => bcrypt(request('password'))
]);
// Sign In
auth()->login($owner);
added the following to config/auth.php
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
'instructors' => [
'driver' => 'eloquent',
'model' => App\Instructor::class,
],
'owners' => [
'driver' => 'eloquent',
'model' => App\Owner::class,
],
],
But this does not authenticate my custom class. Is there something else I should be doing?
Thanks for your help!
Jacob