group(function () { Route::get('page/form/{element}', 'PageAPIController@form'); Route::resource('page', 'PageAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for newcms Route::prefix('{guard}/newcm')->group(function () { Route::get('page/form/{element}', 'PageAPIController@form'); Route::apiResource('page', 'PageAPIController'); }); // Public routes for newcms Route::get('newcm/Page', 'PagePublicController@getPage'); } ); } // API routes for category Route::prefix('{guard}/newcm')->group(function () { Route::get('category/form/{element}', 'CategoryAPIController@form'); Route::resource('category', 'CategoryAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for newcms Route::prefix('{guard}/newcm')->group(function () { Route::get('category/form/{element}', 'CategoryAPIController@form'); Route::apiResource('category', 'CategoryAPIController'); }); // Public routes for newcms Route::get('newcm/Category', 'CategoryPublicController@getCategory'); } ); }