when use auth('api')->user()
return null
this file code config/auth
'defaults' => [ 'guard' => 'web', 'passwords' => 'users', ],
`
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'jwt',
'provider' => 'users',
],
],
`
this is code function boot in class AppServiceProvider
view()->composer('dashboard::layouts.*', function ($view) { dd(auth('api')->user()); $view->with('user', auth('api')->user()); });
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire