Как можно разделить группы роутов Laravel?

Route::namespace('Hr')->group(function () {
    Route::group(['middleware' => ['role:hr']], function () {
        Route::get('otdel/{url}', 'HrController@personList')->name('personal-index');
        Route::get('otdel/{url}/statistic', 'HrController@statistic')->name('personal-statistic');
        Route::get('otdel/{url}/users', 'HrController@users')->name('personal-users');
    });

    Route::group(['middleware' => ['role:hr_rus']], function () {
        Route::get('otdel-ru/{url}', 'HrController@personList')->name('personal-index');
        Route::get('otdel-ru/{url}/statistic', 'HrController@statisticRu')->name('personal-statistic');
        Route::get('otdel/{url}/users', 'HrController@users')->name('personal-users');
    });

    Route::post('otdel/createEmployee', 'HrController@createEployee')->name('createEmployee');
    Route::get('person-delete/{id}', 'HrController@deletePerson')->name('person.delete');
    Route::get('trash/{id}', 'HrController@trashEployee')->name('trashEmployee');
});
  • Вопрос задан
  • 221 просмотр
Пригласить эксперта
Ответы на вопрос 1
astralo
@astralo
для "спасибо" есть кнопка [Нравится]
В RouteServiceProvider можешь по файлам раскидать
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы