What does your controller method look like for admin
?
Also, you might want to tidy these routes up a bit:
/
, to go to the prefix URL:Route::group(array('prefix' => 'admin', 'before' => 'role:administrator'), function()
{
Route::get('/', 'UserController@index');
Route::get('user/{user}/destroy', 'UserController@destroy');
Route::resource('user', 'UserController');
Route::resource('roles', 'RolesController');
});
Route::get('/game', ['as' => 'game', 'uses' => 'GameController@index'])->before('role:member');
// Just do:
Route::get('game', ['as' => 'game', 'uses' => 'GameController@index'])->before('role:member');
role
filter should check the users role, another filter should check if they're logged in or not. This was you can do:before => 'auth|role:administrator'
This way you separate the responsibility of each role and can use them individually.
Thanks for your hints: I changes my Routes to the following: http://laravel.io/bin/88L37
/game ist stoll working and /admin is still running into an endless loop.
I have attached my UserController as /admin should lead to UserController@index method
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community