jeudi 29 mars 2018

laravel 5.5 Multi auth error 'InvalidArgumentException Authentication user provider [] is not defined

The error is

InvalidArgumentException …\vendor\laravel\framework\src\Illuminate\Auth\CreatesUserProviders.php42

config/auth.php

'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
        ],
        'admin' => [
            'driver' => 'session',
            'provider' => 'adminss',
        ],
    ],

Here's my provider array

'providers' => [
    'users' => [
        'driver' => 'eloquent',
        'model' => App\User::class,
    ],
    'admins' => [
            'drivers' => 'eloquent',
            'model' => App\Admin::class,
    ],

],

This is my Admin model

class Admin extends Authenticatable
{
    use Notifiable;

    protected $guard = 'admin';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];

    protected $table = 'admins';


}

This worked in laravel 5.4 but I'm getting error in 5.5



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2GhBhFi
via IFTTT

Aucun commentaire:

Enregistrer un commentaire