group(function () { Route::resource('companies', 'CompaniesResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'CompaniesResourceController'); }); // Public routes for pages Route::get('companies/', 'CompaniesPublicController@index'); Route::get('companies/{slug?}', 'CompaniesPublicController@show'); } ); } // web routes for offices Route::prefix('{guard}/company')->group(function () { Route::resource('offices', 'OfficesResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'OfficesResourceController'); }); // Public routes for pages Route::get('companies/', 'OfficesPublicController@index'); Route::get('companies/{slug?}', 'OfficesPublicController@show'); } ); } // web routes for divisions Route::prefix('{guard}/company')->group(function () { Route::resource('divisions', 'DivisionsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'DivisionsResourceController'); }); // Public routes for pages Route::get('companies/', 'DivisionsPublicController@index'); Route::get('companies/{slug?}', 'DivisionsPublicController@show'); } ); } // web routes for departments Route::prefix('{guard}/company')->group(function () { Route::resource('departments', 'DepartmentsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'DepartmentsResourceController'); }); // Public routes for pages Route::get('companies/', 'DepartmentsPublicController@index'); Route::get('companies/{slug?}', 'DepartmentsPublicController@show'); } ); } // web routes for benefits Route::prefix('{guard}/company')->group(function () { Route::resource('benefits', 'BenefitsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'BenefitsResourceController'); }); // Public routes for pages Route::get('companies/', 'BenefitsPublicController@index'); Route::get('companies/{slug?}', 'BenefitsPublicController@show'); } ); } // web routes for subdivisions Route::prefix('{guard}/company')->group(function () { Route::resource('subdivisions', 'SubdivisionsResourceController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'SubdivisionsResourceController'); }); // Public routes for pages Route::get('companies/', 'SubdivisionsPublicController@index'); Route::get('companies/{slug?}', 'SubdivisionsPublicController@show'); } ); }