This package provides a simple interface to the ActiveCampaign API v3.
Currently the packages only supports the endpoints Contacts
, Custom Fields Values
and Tags
. Feel free to PR the remaining endpoints.
- PHP 8.x
- Laravel 9.x
composer require label84/laravel-active-campaign
php artisan vendor:publish --provider="Label84\ActiveCampaign\ActiveCampaignServiceProvider" --tag="config"
ACTIVE_CAMPAIGN_BASE_URL=
ACTIVE_CAMPAIGN_API_KEY=
use Label84\ActiveCampaign\ActiveCampaign;
$contact = resolve(ActiveCampaign::class)->contacts()->get(1);
use Label84\ActiveCampaign\ActiveCampaign;
$contacts = resolve(ActiveCampaign::class)->contacts()->list('[email protected]');
use Label84\ActiveCampaign\ActiveCampaign;
$contactId = resolve(ActiveCampaign::class)->contacts()->create('[email protected]', [
'firstName' => 'John',
'lastName' => 'Doe',
'phone' => '+3112345678',
]);
use Label84\ActiveCampaign\ActiveCampaign;
use Label84\ActiveCampaign\DataObjects\ActiveCampaignContact;
$contact = new ActiveCampaignContact(1, '[email protected]', '+3112345678', 'John', 'Deer');
$contact = resolve(ActiveCampaign::class)->contacts()->update($contact);
use Label84\ActiveCampaign\ActiveCampaign;
resolve(ActiveCampaign::class)->contacts()->delete(1);
use Label84\ActiveCampaign\ActiveCampaign;
resolve(ActiveCampaign::class)->contacts()->tag(1, 20);
use Label84\ActiveCampaign\ActiveCampaign;
resolve(ActiveCampaign::class)->contacts()->untag(2340);
use Label84\ActiveCampaign\ActiveCampaign;
$fieldValue = resolve(ActiveCampaign::class)->fieldValues()->get(50);
use Label84\ActiveCampaign\ActiveCampaign;
$fieldValue = resolve(ActiveCampaign::class)->fieldValues()->create(1, 50, 'active');
use Label84\ActiveCampaign\ActiveCampaign;
use Label84\ActiveCampaign\DataObjects\ActiveCampaignFieldValue;
$fieldValue = new ActiveCampaignFieldValue(1, 50, 'inactive');
$fieldValue = resolve(ActiveCampaign::class)->fieldValues()->update($fieldValue);
use Label84\ActiveCampaign\ActiveCampaign;
resolve(ActiveCampaign::class)->fieldValues()->delete(50);
use Label84\ActiveCampaign\ActiveCampaign;
$tag = resolve(ActiveCampaign::class)->tags()->get(100);
use Label84\ActiveCampaign\ActiveCampaign;
$tags = resolve(ActiveCampaign::class)->tags()->list('abc');
use Label84\ActiveCampaign\ActiveCampaign;
$tag = resolve(ActiveCampaign::class)->tags()->create('test_tag', 'This is a new tag');
use Label84\ActiveCampaign\ActiveCampaign;
use Label84\ActiveCampaign\DataObjects\ActiveCampaignTag;
$tag = new ActiveCampaignTag(100, 'test_tag', 'Another description');
$tag = resolve(ActiveCampaign::class)->tags()->update($tag);
use Label84\ActiveCampaign\ActiveCampaign;
resolve(ActiveCampaign::class)->tags()->delete(100);
./vendor/bin/phpstan analyse