samedi 5 septembre 2020

How to manage role wise prefix for admin?

I have 2 roles(admin and dealler). When i am login from admin then route prefix show admin and login with dealer then show dealer For Admin : www.mydomain.com/admin/faqs For Dealer : www.mydomain.com/dealer/faqs Faq management controller is same for both roles

Route code :

Route::group(['prefix' => 'admin', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth', 'verified', 'preventBackHistory']], function () {
    Route::resource('faqs', 'FaqsController')->only(['index','store']);
});


Route::group(['prefix' => 'dealer', 'as' => 'admin.', 'namespace' => 'Admin', 'middleware' => ['auth', 'verified', 'preventBackHistory']], function () {
    Route::resource('faqs', 'FaqsController')->only(['index','store']);
});

only prefix change but controller and route same

Please suggest me



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire