PHPackages                             vsimke/laravel-activecampaign - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. vsimke/laravel-activecampaign

ActiveLibrary[API Development](/categories/api)

vsimke/laravel-activecampaign
=============================

A Laravel package for the ActiveCampaign API.

v0.1.0-beta(1mo ago)00MITPHPPHP &gt;=8.2CI passing

Since Apr 22Pushed 1mo agoCompare

[ Source](https://github.com/vsimke/laravel-activecampaign)[ Packagist](https://packagist.org/packages/vsimke/laravel-activecampaign)[ RSS](/packages/vsimke-laravel-activecampaign/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (10)Versions (2)Used By (0)

Laravel ActiveCampaign
======================

[](#laravel-activecampaign)

A Laravel package for the [ActiveCampaign](https://www.activecampaign.com/) API.

[![Build Status](https://github.com/vsimke/laravel-activecampaign/workflows/tests/badge.svg)](https://github.com/vsimke/laravel-activecampaign/actions)[![Total Downloads](https://camo.githubusercontent.com/28cfe04be4fa6335d5363ff759e8cb6476407a3b5a6a9f1ded14afbe182b2a9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7673696d6b652f6c61726176656c2d61637469766563616d706169676e)](https://packagist.org/packages/vsimke/laravel-activecampaign)[![Latest Stable Version](https://camo.githubusercontent.com/7f5c8cd64d53fb82b538d98ed78ba4d5b315ac74c01d11655d754d6833ff7541/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7673696d6b652f6c61726176656c2d61637469766563616d706169676e)](https://packagist.org/packages/vsimke/laravel-activecampaign)[![GitHub Tag](https://camo.githubusercontent.com/cb8f9465cad4c528ab7b071115f8d751bbaddd6da2f130a15a0dfa4698e303ee/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f7673696d6b652f6c61726176656c2d61637469766563616d706169676e)](https://github.com/vsimke/laravel-activecampaign/releases)[![License](https://camo.githubusercontent.com/cd655de107d79d8f3c1c857cee20f108a38c63d0be41039297381594110a3d16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7673696d6b652f6c61726176656c2d61637469766563616d706169676e)](https://packagist.org/packages/vsimke/laravel-activecampaign)

> **⚠️ Beta Release**: This is an early release for testing and community feedback. The API is stable but real-world integration testing is ongoing. Expect minor changes before v1.0.0.

Requirements
------------

[](#requirements)

- PHP 8.2+ (PHP 8.3+ required for Laravel 13)
- Laravel 10, 11, 12, or 13

Installation
------------

[](#installation)

```
composer require vsimke/laravel-activecampaign
```

### Publish the config file

[](#publish-the-config-file)

```
php artisan vendor:publish --provider="Vsimke\ActiveCampaign\ActiveCampaignServiceProvider" --tag=activecampaign-config
```

### Publish and run the migration

[](#publish-and-run-the-migration)

```
php artisan vendor:publish --provider="Vsimke\ActiveCampaign\ActiveCampaignServiceProvider" --tag=activecampaign-migrations
php artisan migrate
```

Configuration
-------------

[](#configuration)

Add your ActiveCampaign credentials to `.env`:

```
ACTIVECAMPAIGN_URL=https://youraccountname.api-us1.com
ACTIVECAMPAIGN_KEY=your-api-key
```

Then configure lists and tags in `config/activecampaign.php`:

```
'lists' => [
    ['slug' => 'newsletter', 'id' => 1],
    ['slug' => 'affiliates',  'id' => 2],
],

'tags' => [
    ['slug' => 'new-lead',  'name' => 'New Lead',  'id' => 10],
    ['slug' => 'converted', 'name' => 'Converted', 'id' => 11],
],
```

Slugs are application-level identifiers used throughout the package API. The `id` values come from your ActiveCampaign account.

Custom Fields
-------------

[](#custom-fields)

The package stores the mapping of ActiveCampaign custom field IDs to their `perstag` identifiers in the `active_campaign_custom_fields` database table. Populate it by seeding or syncing from the API.

Usage
-----

[](#usage)

### Facade

[](#facade)

```
use Vsimke\ActiveCampaign\Facades\ActiveCampaign;

$contact = ActiveCampaign::contacts()->find('john@example.com');
```

### Dependency injection

[](#dependency-injection)

```
use Vsimke\ActiveCampaign\ActiveCampaign;

class MyService
{
    public function __construct(private readonly ActiveCampaign $ac) {}

    public function sync(): void
    {
        $contact = $this->ac->contacts()->find('john@example.com');
    }
}
```

---

### Contacts

[](#contacts)

#### Find by email

[](#find-by-email)

```
$contact = ActiveCampaign::contacts()->find('john@example.com');
// ['id' => '1', 'email' => 'john@example.com', ...]
```

#### Create or update (sync)

[](#create-or-update-sync)

```
use Vsimke\ActiveCampaign\Requests\CreateContactRequest;

$request = (new CreateContactRequest)
    ->setEmail('john@example.com')
    ->setFirstName('John')
    ->setLastName('Doe')
    ->setPhone('+41791234567')
    ->setFieldValue('COUNTRY', 'Switzerland');   // perstag => value

$contact = ActiveCampaign::contacts()->updateOrCreate($request);
```

> `setFieldValue()` accepts a `perstag` string. The package resolves it to the ActiveCampaign field ID at runtime using the `active_campaign_custom_fields` table.

#### Update by ID

[](#update-by-id)

```
$contact = ActiveCampaign::contacts()->update(42, $request);
```

#### Remove

[](#remove)

```
ActiveCampaign::contacts()->remove(42);
```

#### Add to a list

[](#add-to-a-list)

```
ActiveCampaign::contacts()->addToList($contactId, 'newsletter');
```

---

### Tags

[](#tags)

```
$tags = ActiveCampaign::contacts()->tags();

// Add a tag
$tags->add($contactId, 'new-lead');

// Remove a tag
$tags->remove($contactId, 'new-lead');

// Find a specific tag on a contact
$tag = $tags->find($contactId, 'new-lead');

// List all tags for a contact
$all = $tags->list($contactId);
```

---

### Custom Fields (API)

[](#custom-fields-api)

```
use Vsimke\ActiveCampaign\Requests\CreateCustomFieldRequest;
use Vsimke\ActiveCampaign\Requests\UpdateCustomFieldRequest;

$fields = ActiveCampaign::contacts()->customFields();

// Create
$field = $fields->create(new CreateCustomFieldRequest([
    'title'   => 'Country',
    'type'    => 'text',
    'perstag' => 'COUNTRY',
]));

// Update
$field = $fields->update(1, new UpdateCustomFieldRequest([
    'title'   => 'Country (updated)',
    'type'    => 'text',
    'perstag' => 'COUNTRY',
]));

// List
$all = $fields->list();

// Remove
$fields->remove(1);

// Relate to a list
$fields->relationship($fieldId, $listId);
```

---

### Bulk import

[](#bulk-import)

```
use Vsimke\ActiveCampaign\Requests\BulkCreateContactRequest;
use Vsimke\ActiveCampaign\Requests\BulkCreateContactsRequest;

$config = config('activecampaign');

$contact1 = (new BulkCreateContactRequest($config))
    ->setEmail('alice@example.com')
    ->setFirstName('Alice')
    ->addTag('new-lead')
    ->addToList('newsletter');

$contact2 = (new BulkCreateContactRequest($config))
    ->setEmail('bob@example.com')
    ->setFirstName('Bob')
    ->addToList('affiliates');

$bulk = (new BulkCreateContactsRequest([$contact1, $contact2]))
    ->setCallbackUrl(route('activecampaign.bulk_import.callback'))
    ->addParam('batch_id', 'abc-123');

$batchId = ActiveCampaign::contacts()->bulkUpdateOrCreate($bulk);
```

---

Development
-----------

[](#development)

### Static analysis

[](#static-analysis)

```
./vendor/bin/phpstan analyse
```

### Rector

[](#rector)

```
# Dry run
./vendor/bin/rector process --dry-run

# Apply changes
./vendor/bin/rector process
```

### Tests

[](#tests)

```
./vendor/bin/pest
```

License
-------

[](#license)

MIT — see [LICENSE](https://opensource.org/licenses/MIT).

###  Health Score

33

—

LowBetter than 73% of packages

Maintenance90

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

48d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d28d40355dcf83673ab7a0440e9928e83f2d942ed304b79a603fb0885d0891c?d=identicon)[vsimke](/maintainers/vsimke)

---

Top Contributors

[![vsimke](https://avatars.githubusercontent.com/u/5629780?v=4)](https://github.com/vsimke "vsimke (5 commits)")

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/vsimke-laravel-activecampaign/health.svg)

```
[![Health](https://phpackages.com/badges/vsimke-laravel-activecampaign/health.svg)](https://phpackages.com/packages/vsimke-laravel-activecampaign)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

87311.3M149](/packages/spatie-laravel-health)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[simplestats-io/laravel-client

Analytics for Laravel. Track visitors, registrations, and payments. Discover which channels actually drive revenue, not just traffic. Server-side, GDPR compliant, ad-blocker proof.

5019.3k](/packages/simplestats-io-laravel-client)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1232.2k16](/packages/fleetbase-core-api)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1348.1k1](/packages/jasara-php-amzn-selling-partner-api)[rapidez/core

Rapidez Core

1822.4k65](/packages/rapidez-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
