group(function () { Route::resource('advertising', 'AdvertisingResourceController'); }); // Public routes for advertising Route::get('advertisings/', 'AdvertisingPublicController@index'); Route::get('advertisings/{slug?}', 'AdvertisingPublicController@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', 'AdvertisingResourceController'); }); // Public routes for pages Route::get('advertisings/', 'AdvertisingPublicController@index'); Route::get('advertisings/{slug?}', 'AdvertisingPublicController@show'); } ); } // web routes for favorite Route::prefix('{guard}/advertising')->group(function () { Route::resource('favorite', 'FavoriteResourceController'); }); // Public routes for favorite Route::get('advertisings/', 'FavoritePublicController@index'); Route::get('advertisings/{slug?}', 'FavoritePublicController@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', 'FavoriteResourceController'); }); // Public routes for pages Route::get('advertisings/', 'FavoritePublicController@index'); Route::get('advertisings/{slug?}', 'FavoritePublicController@show'); } ); }