I am trying to implement a custom auth provider by following this guide: http://laravel-recipes.com/recipes/115/using-your-own-authentication-driver
In my project, I have created the following file:
app/Latheesan/Extensions/DummyAuthProvider.php
with the sample code from Step #1 and renamed "MyApp
" to "Latheesan
".
I then went to add the following line in my app/start/global.php
Auth::extend('dummy', function($app) {
return new Latheesan\Extensions\DummyAuthProvider;
});
Then updated the app/auth/config.php and changed the driver like so:
'driver' => 'dummy',
Finally I amended my routes.php
like this:
Route::filter('auth', function($route, $request) {
if (Auth::guest())
return Redirect::guest('login');
});
Route::get('login', array('uses' => 'HomeController@showLogin'));
Route::post('login', array('uses' => 'HomeController@doLogin'));
Route::get('logout', array('uses' => 'HomeController@doLogout'));
Route::get('/', function() {
return View::make('hello');
})->before('auth');
Before I tested my code, I ran the composer dump-auto to generate autoload files.
When I visited my test site: http://laravel-test.local I am getting this error:
Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_ERROR) Class 'Latheesan\Extensions\DummyAuthProvider' not found
Any idea why my custom auth provider class isn't loading?