mardi 28 août 2018

Auth::id() returns null laravel

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 Illuminate\Support\Facades\Auth;

this is my route which is stored inside api.php

Route::resource('users','Users\AdminUsersController')->except([
    'create', 'edit'
]);



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire