group(function () { Route::get('advertising/form/{element}', 'AdvertisingAPIController@form'); Route::resource('advertising', 'AdvertisingAPIController'); }); // 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 advertisings Route::prefix('{guard}/advertising')->group(function () { Route::get('advertising/form/{element}', 'AdvertisingAPIController@form'); Route::apiResource('advertising', 'AdvertisingAPIController'); }); // Public routes for advertisings Route::get('advertising/Advertising', 'AdvertisingPublicController@getAdvertising'); } ); } // API routes for favorite Route::prefix('{guard}/advertising')->group(function () { Route::get('favorite/form/{element}', 'FavoriteAPIController@form'); Route::resource('favorite', 'FavoriteAPIController'); }); // 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 advertisings Route::prefix('{guard}/advertising')->group(function () { Route::get('favorite/form/{element}', 'FavoriteAPIController@form'); Route::apiResource('favorite', 'FavoriteAPIController'); }); // Public routes for advertisings Route::get('advertising/Favorite', 'FavoritePublicController@getFavorite'); } ); }