myth/auth service not working and return null |
Hello everyone
Myth/auth Auth\Controllers\AuthController.php : ~ 29 $this->config = config('Auth'); $this->auth = service('authentication'); if ($this->auth->check()) : ~ 46 This two lines return null and this error message: Call to a member function check() on null
Solved.
In Linux system, paths must contain / but my local machine have Windows and in windows system paths have \ . Just modify the psr4 paths: In Windows server: public $psr4 = [ APP_NAMESPACE => APPPATH, // For custom app namespace 'App' => APPPATH, // To ensure filters, etc still found, 'Config' => APPPATH .'Config', 'Addon' => ROOTPATH .'addon', 'Blog' => ROOTPATH .'addon\Blog', 'Auth' => ROOTPATH .'addon\Auth' ]; In Linux server: public $psr4 = [ APP_NAMESPACE => APPPATH, // For custom app namespace 'App' => APPPATH, // To ensure filters, etc still found, 'Config' => APPPATH .'Config', 'Addon' => ROOTPATH .'addon', 'Blog' => ROOTPATH .'addon/Blog', 'Auth' => ROOTPATH .'addon/Auth' ];
you can use the DIRECTORY_SEPARATOR constant instead of changing it manually in between servers
|
Welcome Guest, Not a member yet? Register Sign In |