samedi 1 juillet 2017

Laravel 5 Target [Illuminate\Contracts\Auth\UserProvider] is not instantiable while building TokenGuard

Controller constructor:

public function __construct(TokenGuard $guard) {
    //
}

I'm doing this because i want to avoid using Facades like \Auth.

Why isn't that instantiable? My controller is in routes/api.php, config/auth.php is vanilla:

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

    'api' => [
        'driver' => 'token',
        'provider' => 'users',
    ],
],

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

    // 'users' => [
    //     'driver' => 'database',
    //     'table' => 'users',
    // ],
],



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

Aucun commentaire:

Enregistrer un commentaire