group(function () { Route::get('campaign_task/form/{element}', 'CampaignTaskAPIController@form'); Route::resource('campaign_task', 'CampaignTaskAPIController'); }); // Public routes for campaign_task Route::get('campaigns/', 'CampaignTaskPublicController@index'); Route::get('campaigns/{slug?}', 'CampaignTaskPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for campaigns Route::prefix('{guard}/campaign')->group(function () { Route::get('campaign_task/form/{element}', 'CampaignTaskAPIController@form'); Route::apiResource('campaign_task', 'CampaignTaskAPIController'); }); // Public routes for campaigns Route::get('campaign/CampaignTask', 'CampaignTaskPublicController@getCampaignTask'); } ); } // API routes for campaign Route::prefix('{guard}/campaign')->group(function () { Route::get('campaign/form/{element}', 'CampaignAPIController@form'); Route::resource('campaign', 'CampaignAPIController'); }); // Public routes for campaign Route::get('campaigns/', 'CampaignPublicController@index'); Route::get('campaigns/{slug?}', 'CampaignPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for campaigns Route::prefix('{guard}/campaign')->group(function () { Route::get('campaign/form/{element}', 'CampaignAPIController@form'); Route::apiResource('campaign', 'CampaignAPIController'); }); // Public routes for campaigns Route::get('campaign/Campaign', 'CampaignPublicController@getCampaign'); } ); } // API routes for campaign_variant Route::prefix('{guard}/campaign')->group(function () { Route::get('campaign_variant/form/{element}', 'CampaignVariantAPIController@form'); Route::resource('campaign_variant', 'CampaignVariantAPIController'); }); // Public routes for campaign_variant Route::get('campaigns/', 'CampaignVariantPublicController@index'); Route::get('campaigns/{slug?}', 'CampaignVariantPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for campaigns Route::prefix('{guard}/campaign')->group(function () { Route::get('campaign_variant/form/{element}', 'CampaignVariantAPIController@form'); Route::apiResource('campaign_variant', 'CampaignVariantAPIController'); }); // Public routes for campaigns Route::get('campaign/CampaignVariant', 'CampaignVariantPublicController@getCampaignVariant'); } ); } // API routes for campign_cooperation Route::prefix('{guard}/campaign')->group(function () { Route::get('campign_cooperation/form/{element}', 'CampignCooperationAPIController@form'); Route::resource('campign_cooperation', 'CampignCooperationAPIController'); }); // Public routes for campign_cooperation Route::get('campaigns/', 'CampignCooperationPublicController@index'); Route::get('campaigns/{slug?}', 'CampignCooperationPublicController@show'); if (Trans::isMultilingual()) { Route::group( [ 'prefix' => '{trans}', 'where' => ['trans' => Trans::keys('|')], ], function () { // Guard routes for campaigns Route::prefix('{guard}/campaign')->group(function () { Route::get('campign_cooperation/form/{element}', 'CampignCooperationAPIController@form'); Route::apiResource('campign_cooperation', 'CampignCooperationAPIController'); }); // Public routes for campaigns Route::get('campaign/CampignCooperation', 'CampignCooperationPublicController@getCampignCooperation'); } ); }