group(function () { Route::get('product/form/{element}', 'ProductAPIController@form'); Route::resource('product', 'ProductAPIController'); }); // Public routes for product Route::get('products/', 'ProductPublicController@index'); Route::get('products/{slug?}', 'ProductPublicController@show'); 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/form/{element}', 'ProductAPIController@form'); Route::apiResource('product', 'ProductAPIController'); }); // Public routes for products Route::get('product/Product', 'ProductPublicController@getProduct'); } ); }