dimanche 4 juin 2017

BadMethodCallException: Call to undefined > method Cartalyst\Sentinel\Sentinel::user()

Im using Cartalyst Sentinel to provide Auth/Roles to my Laravel Application.

Despite I checked in my code the following error is displayed in some controllers:

BadMethodCallException in Sentinel.php line 891: Call to undefined method Cartalyst\Sentinel\Sentinel::user()

  • My App.php file has Sentinel as an alias.
  • My code uses Sentinel::check() and Sentinel::getUser() with success in several areas.
  • My routes only display Route::group(['middleware' => ['auth']], function () (in order to protect routes with login request). (this is working ok in several controllers).

the complete log details the following information:

in Sentinel.php line 891 
at Sentinel->__call('user', array()) in Facade.php line 221 
at Facade::__callStatic('user', array()) in MultitenantScope.php line 16 
at MultitenantScope->apply(object(Builder), object(Department)) in Builder.php line 904 
at Builder->Illuminate\Database\Eloquent\{closure}(object(Builder)) in Builder.php line 930 
at Builder->callScope(object(Closure)) in Builder.php line 906 
at Builder->applyScopes() in Builder.php line 442 
at Builder->get() in DepartmentEntity.php line 25 at DepartmentEntity->all(array('sort' => array('sortBy' => null, 'direction' => null), 'page' => 1, 'search' => array('search' => null))) in DepartmentController.php line 36 at DepartmentController->index() 
at call_user_func_array(array(object(DepartmentController), 'index'), array()) in Controller.php line 55 
at Controller->callAction('index', array()) in ControllerDispatcher.php line 44 
at ControllerDispatcher->dispatch(object(Route), object(DepartmentController), 'index') in Route.php line 203 
at Route->runController() in Route.php line 160 
at Route->run() in Router.php line 559

But I cannot find any details about what is failing to solve it in my code.

Any help to know what can I do in order to debug properly my code appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire