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