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'); } ); }