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