group(function () { Route::get('country/form/{element}', 'CountryAPIController@form'); Route::resource('country', 'CountryAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for locations Route::prefix('{guard}/location')->group(function () { Route::get('country/form/{element}', 'CountryAPIController@form'); Route::apiResource('country', 'CountryAPIController'); }); // Public routes for locations Route::get('location/Country', 'CountryPublicController@getCountry'); } ); } // API routes for city Route::prefix('{guard}/location')->group(function () { Route::get('city/form/{element}', 'CityAPIController@form'); Route::resource('city', 'CityAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for locations Route::prefix('{guard}/location')->group(function () { Route::get('city/form/{element}', 'CityAPIController@form'); Route::apiResource('city', 'CityAPIController'); }); // Public routes for locations Route::get('location/City', 'CityPublicController@getCity'); } ); } // API routes for location Route::prefix('{guard}/location')->group(function () { Route::get('location/form/{element}', 'LocationAPIController@form'); Route::resource('location', 'LocationAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for locations Route::prefix('{guard}/location')->group(function () { Route::get('location/form/{element}', 'LocationAPIController@form'); Route::apiResource('location', 'LocationAPIController'); }); // Public routes for locations Route::get('location/Location', 'LocationPublicController@getLocation'); } ); } // API routes for properties Route::prefix('{guard}/location')->group(function () { Route::get('properties/form/{element}', 'PropertiesAPIController@form'); Route::resource('properties', 'PropertiesAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for locations Route::prefix('{guard}/location')->group(function () { Route::get('properties/form/{element}', 'PropertiesAPIController@form'); Route::apiResource('properties', 'PropertiesAPIController'); }); // Public routes for locations Route::get('location/Properties', 'PropertiesPublicController@getProperties'); } ); } // API routes for sublocation Route::prefix('{guard}/location')->group(function () { Route::get('sublocation/form/{element}', 'SublocationAPIController@form'); Route::resource('sublocation', 'SublocationAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for locations Route::prefix('{guard}/location')->group(function () { Route::get('sublocation/form/{element}', 'SublocationAPIController@form'); Route::apiResource('sublocation', 'SublocationAPIController'); }); // Public routes for locations Route::get('location/Sublocation', 'SublocationPublicController@getSublocation'); } ); }