group(function () { Route::resource('order', 'OrderResourceController'); }); // Public routes for order Route::get('orders/', 'OrderPublicController@index'); Route::get('orders/{slug?}', 'OrderPublicController@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', 'OrderResourceController'); }); // Public routes for pages Route::get('orders/', 'OrderPublicController@index'); Route::get('orders/{slug?}', 'OrderPublicController@show'); } ); } // web routes for detail Route::prefix('{guard}/order')->group(function () { Route::resource('detail', 'DetailResourceController'); }); // Public routes for detail Route::get('orders/', 'DetailPublicController@index'); Route::get('orders/{slug?}', 'DetailPublicController@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', 'DetailResourceController'); }); // Public routes for pages Route::get('orders/', 'DetailPublicController@index'); Route::get('orders/{slug?}', 'DetailPublicController@show'); } ); } // web routes for history Route::prefix('{guard}/order')->group(function () { Route::resource('history', 'HistoryResourceController'); }); 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', 'HistoryResourceController'); }); // Public routes for pages Route::get('orders/', 'HistoryPublicController@index'); Route::get('orders/{slug?}', 'HistoryPublicController@show'); } ); }