group(function () { Route::get('store/form/{element}', 'StoreAPIController@form'); Route::resource('store', 'StoreAPIController'); }); // Public routes for store Route::get('stores/', 'StorePublicController@index'); Route::get('stores/{slug?}', 'StorePublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for stores Route::prefix('{guard}/store')->group(function () { Route::get('store/form/{element}', 'StoreAPIController@form'); Route::apiResource('store', 'StoreAPIController'); }); // Public routes for stores Route::get('store/Store', 'StorePublicController@getStore'); } ); } // API routes for stock Route::prefix('{guard}/store')->group(function () { Route::get('stock/form/{element}', 'StockAPIController@form'); Route::resource('stock', 'StockAPIController'); }); // Public routes for stock Route::get('stores/', 'StockPublicController@index'); Route::get('stores/{slug?}', 'StockPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for stores Route::prefix('{guard}/store')->group(function () { Route::get('stock/form/{element}', 'StockAPIController@form'); Route::apiResource('stock', 'StockAPIController'); }); // Public routes for stores Route::get('store/Stock', 'StockPublicController@getStock'); } ); }