I have an error in the Laravel enroutado I am using AdminLTE as a design and Entrust for the user level control but I want that when login as admin is redirected to another routa that is in the AdminController and with the same user to have everything well controlled and avoid the spaghetti code that would be done if I do everything with @role
Route::group(['middleware' => 'auth'], function () {
// Route::get('/link1', function () {
// Uses Auth Middleware });
//Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly.
#adminlte_routes
});
Route::group(['middleware' => ['role:admin']], function() {
Route::get('/home', 'AdminController@index'); });
Route::group(['middleware' => ['role:user']], function() {
Route::get('/home', 'UserController@index'); });
when I use one of the route :: group of role: admin or role: user starts to give errors the login and logout gives an error when trying to go to the page / home (home page of the 2 controller), but If I return to the main page the (index) is logged in.
In essence, I can not have those 2 Route :: group and for reasons of order it is necessary to use them