vendredi 29 décembre 2017

how to redirect user according to role in laravel 5.4

I am using laratrust package. i have multiple user roles i want to redirect user according to their role but i am not able to redirect user according their role.

route.php

// If User Role Master Administration Call this Route
Route::group(['prefix' => 'dashboard', 'middleware' => ['role:master-admin']], function(){

    Route::get('/', 'HomeController@index')->name('home');
    Route::resource('/branches','BranchController');
});



// If User Role Company Admin Call this Route
Route::group(['prefix' => 'dashboard', 'middleware' => ['role:company-admin']], function(){
    Route::resource('/','CompanyController');
});

// If User Role guest user Call this Route
Route::group(['prefix' => 'dashboard', 'middleware' => ['role:guest-user']], function(){
    Route::resource('/','CompanyController');
});



Route::get('/error','error\ErrorController@pageNotFound');



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BUOIFc
via IFTTT

Aucun commentaire:

Enregistrer un commentaire