group(function () { Route::get('site/form/{element}', 'SiteAPIController@form'); Route::resource('site', 'SiteAPIController'); }); // Public routes for site Route::get('sites/', 'SitePublicController@index'); Route::get('sites/{slug?}', 'SitePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for sites Route::prefix('{guard}/site')->group(function () { Route::get('site/form/{element}', 'SiteAPIController@form'); Route::apiResource('site', 'SiteAPIController'); }); // Public routes for sites Route::get('site/Site', 'SitePublicController@getSite'); } ); } // API routes for department Route::prefix('{guard}/site')->group(function () { Route::get('department/form/{element}', 'DepartmentAPIController@form'); Route::resource('department', 'DepartmentAPIController'); }); // Public routes for department Route::get('sites/', 'DepartmentPublicController@index'); Route::get('sites/{slug?}', 'DepartmentPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for sites Route::prefix('{guard}/site')->group(function () { Route::get('department/form/{element}', 'DepartmentAPIController@form'); Route::apiResource('department', 'DepartmentAPIController'); }); // Public routes for sites Route::get('site/Department', 'DepartmentPublicController@getDepartment'); } ); } // API routes for center Route::prefix('{guard}/site')->group(function () { Route::get('center/form/{element}', 'CenterAPIController@form'); Route::resource('center', 'CenterAPIController'); }); // Public routes for center Route::get('sites/', 'CenterPublicController@index'); Route::get('sites/{slug?}', 'CenterPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for sites Route::prefix('{guard}/site')->group(function () { Route::get('center/form/{element}', 'CenterAPIController@form'); Route::apiResource('center', 'CenterAPIController'); }); // Public routes for sites Route::get('site/Center', 'CenterPublicController@getCenter'); } ); } // API routes for district Route::prefix('{guard}/site')->group(function () { Route::get('district/form/{element}', 'DistrictAPIController@form'); Route::resource('district', 'DistrictAPIController'); }); // Public routes for district Route::get('sites/', 'DistrictPublicController@index'); Route::get('sites/{slug?}', 'DistrictPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for sites Route::prefix('{guard}/site')->group(function () { Route::get('district/form/{element}', 'DistrictAPIController@form'); Route::apiResource('district', 'DistrictAPIController'); }); // Public routes for sites Route::get('site/District', 'DistrictPublicController@getDistrict'); } ); }