group(function () { Route::get('cart/form/{element}', 'CartAPIController@form'); Route::resource('cart', 'CartAPIController'); }); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for carts Route::prefix('{guard}/cart')->group(function () { Route::get('cart/form/{element}', 'CartAPIController@form'); Route::apiResource('cart', 'CartAPIController'); }); // Public routes for carts Route::get('cart/Cart', 'CartPublicController@getCart'); } ); }