group(function () { Route::resource('store', 'StoreResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'StoreResourceController'); }); // Public routes for pages Route::get('stores/', 'StorePublicController@index'); Route::get('stores/{slug?}', 'StorePublicController@show'); } ); } // web routes for stock Route::prefix('{guard}/store')->group(function () { Route::resource('stock', 'StockResourceController'); }); // 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 pages Route::prefix('{guard}/page')->group(function () { Route::apiResource('page', 'StockResourceController'); }); // Public routes for pages Route::get('stores/', 'StockPublicController@index'); Route::get('stores/{slug?}', 'StockPublicController@show'); } ); }