group(function () { Route::get('companies/form/{element}', 'CompaniesAPIController@form'); Route::resource('companies', 'CompaniesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('companies/form/{element}', 'CompaniesAPIController@form'); Route::apiResource('companies', 'CompaniesAPIController'); }); // Public routes for companies Route::get('company/Companies', 'CompaniesPublicController@getCompanies'); } ); } // API routes for offices Route::prefix('{guard}/company')->group(function () { Route::get('offices/form/{element}', 'OfficesAPIController@form'); Route::resource('offices', 'OfficesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('offices/form/{element}', 'OfficesAPIController@form'); Route::apiResource('offices', 'OfficesAPIController'); }); // Public routes for companies Route::get('company/Offices', 'OfficesPublicController@getOffices'); } ); } // API routes for divisions Route::prefix('{guard}/company')->group(function () { Route::get('divisions/form/{element}', 'DivisionsAPIController@form'); Route::resource('divisions', 'DivisionsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('divisions/form/{element}', 'DivisionsAPIController@form'); Route::apiResource('divisions', 'DivisionsAPIController'); }); // Public routes for companies Route::get('company/Divisions', 'DivisionsPublicController@getDivisions'); } ); } // API routes for departments Route::prefix('{guard}/company')->group(function () { Route::get('departments/form/{element}', 'DepartmentsAPIController@form'); Route::resource('departments', 'DepartmentsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('departments/form/{element}', 'DepartmentsAPIController@form'); Route::apiResource('departments', 'DepartmentsAPIController'); }); // Public routes for companies Route::get('company/Departments', 'DepartmentsPublicController@getDepartments'); } ); } // API routes for benefits Route::prefix('{guard}/company')->group(function () { Route::get('benefits/form/{element}', 'BenefitsAPIController@form'); Route::resource('benefits', 'BenefitsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('benefits/form/{element}', 'BenefitsAPIController@form'); Route::apiResource('benefits', 'BenefitsAPIController'); }); // Public routes for companies Route::get('company/Benefits', 'BenefitsPublicController@getBenefits'); } ); } // API routes for subdivisions Route::prefix('{guard}/company')->group(function () { Route::get('subdivisions/form/{element}', 'SubdivisionsAPIController@form'); Route::resource('subdivisions', 'SubdivisionsAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for companies Route::prefix('{guard}/company')->group(function () { Route::get('subdivisions/form/{element}', 'SubdivisionsAPIController@form'); Route::apiResource('subdivisions', 'SubdivisionsAPIController'); }); // Public routes for companies Route::get('company/Subdivisions', 'SubdivisionsPublicController@getSubdivisions'); } ); }