group(function () { Route::get('group/form/{element}', 'GroupAPIController@form'); Route::resource('group', 'GroupAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for products Route::prefix('{guard}/product')->group(function () { Route::get('group/form/{element}', 'GroupAPIController@form'); Route::apiResource('group', 'GroupAPIController'); }); // Public routes for products Route::get('product/Group', 'GroupPublicController@getGroup'); } ); } // API routes for attribute Route::prefix('{guard}/product')->group(function () { Route::get('attribute/form/{element}', 'AttributeAPIController@form'); Route::resource('attribute', 'AttributeAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for products Route::prefix('{guard}/product')->group(function () { Route::get('attribute/form/{element}', 'AttributeAPIController@form'); Route::apiResource('attribute', 'AttributeAPIController'); }); // Public routes for products Route::get('product/Attribute', 'AttributePublicController@getAttribute'); } ); } // API routes for product_attribute Route::prefix('{guard}/product')->group(function () { Route::get('product_attribute/form/{element}', 'ProductAttributeAPIController@form'); Route::resource('product_attribute', 'ProductAttributeAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for products Route::prefix('{guard}/product')->group(function () { Route::get('product_attribute/form/{element}', 'ProductAttributeAPIController@form'); Route::apiResource('product_attribute', 'ProductAttributeAPIController'); }); // Public routes for products Route::get('product/ProductAttribute', 'ProductAttributePublicController@getProductAttribute'); } ); } // API routes for product_group Route::prefix('{guard}/product')->group(function () { Route::get('product_group/form/{element}', 'ProductGroupAPIController@form'); Route::resource('product_group', 'ProductGroupAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for products Route::prefix('{guard}/product')->group(function () { Route::get('product_group/form/{element}', 'ProductGroupAPIController@form'); Route::apiResource('product_group', 'ProductGroupAPIController'); }); // Public routes for products Route::get('product/ProductGroup', 'ProductGroupPublicController@getProductGroup'); } ); }