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',
// ],
],
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire