group(function () { Route::get('advertisement/form/{element}', 'AdvertisementAPIController@form'); Route::resource('advertisement', 'AdvertisementAPIController'); }); // 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 advertisements Route::prefix('{guard}/advertisement')->group(function () { Route::get('advertisement/form/{element}', 'AdvertisementAPIController@form'); Route::apiResource('advertisement', 'AdvertisementAPIController'); }); // Public routes for advertisements Route::get('advertisement/Advertisement', 'AdvertisementPublicController@getAdvertisement'); } ); } // API routes for favorite Route::prefix('{guard}/advertisement')->group(function () { Route::get('favorite/form/{element}', 'FavoriteAPIController@form'); Route::resource('favorite', 'FavoriteAPIController'); }); // 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 advertisements Route::prefix('{guard}/advertisement')->group(function () { Route::get('favorite/form/{element}', 'FavoriteAPIController@form'); Route::apiResource('favorite', 'FavoriteAPIController'); }); // Public routes for advertisements Route::get('advertisement/Favorite', 'FavoritePublicController@getFavorite'); } ); }