ollieread / multiauth

Laravel multi auth
441 stars 109 forks source link

Getting call to undefined method Ollieread\Multiauth\MultiauthServiceProvider::admin() where "admin()" is user type defined in auth.php #57

Closed hardik-creolestudios closed 9 years ago

hardik-creolestudios commented 9 years ago

Hello Sir,

I am new here. So please forgive any mistakes. I do not know weather this is issue or not. Multi auth is installed successfully according the instructions provided in documentation. After that I changed app/config/app.php and app/config/auth.php as per instruction. Following code is from auth.php 'multi' => array ( 'admin' => array ( 'driver' => 'database', 'table' => 'adminusers' ), 'front' => array ( 'driver' => 'database', 'table' => 'users' ) ), New filter named auth.admin created in app/filters.php file which is as below

Route::filter('auth.admin', function() { //dd(Auth); if (Auth::admin()->guest()) return Redirect::guest('login.html'); });

And below code is In main route file

Route::group(array('prefix' => 'admin', 'before' => 'auth.admin', 'namespace' => 'Admin'), function() {

Route::any("login.html",'LoginController@login');
Route::any("/",'DashboardController@index');

});

While calling http://localhost/project/public/admin below errorpage is coming.

image

I debug using 'echo exit;' and found out app/config/auth.php file is not actually getting include. But "echo exit;" is working app/config/app.php and app/config/database.php file

Am I missing something here ?

hardik-creolestudios commented 9 years ago

Solution is already provided here https://github.com/ollieread/multiauth/issues/53

hardik-creolestudios commented 9 years ago

Hello sir, Thank you very much for this fantastic plugin. And I apologize for my stupidit. As solution is already provided here #53.

ollieread commented 9 years ago

No problem, I'm glad you're finding this useful :)