i have a function where
public function index(){
$users = User::doesntHave('roles')->latest()->paginate()->except(Auth::id());
return UsersResource::collection($users);
}
when i dd the Auth::id()
it returns null even if I declared the auth facade on my controller
use IlluminateSupportFacadesAuth;
this is my route which is stored inside api.php
Route::resource('users','UsersAdminUsersController')->except([
'create', 'edit'
]);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…