PHPackages                             emailfunnelai/sdk-laravel - 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. emailfunnelai/sdk-laravel

ActiveLibrary

emailfunnelai/sdk-laravel
=========================

Laravel integration for the Email Funnel AI SDK — facade, config, and auto-wired client.

00

Since Jul 22Compare

[ Source](https://github.com/EmailFunnelAI/sdk-laravel)[ Packagist](https://packagist.org/packages/emailfunnelai/sdk-laravel)[ RSS](/packages/emailfunnelai-sdk-laravel/feed)WikiDiscussions Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Email Funnel AI — Laravel
=========================

[](#email-funnel-ai--laravel)

Official Laravel package for the [Email Funnel AI](https://emailfunnel.ai)integration API. Ships a self-contained client with a service provider, a facade, and publishable config — credentials come from your `.env`, and the client is auto-wired into the container.

- Laravel 10, 11, 12
- Auto-discovered provider + `EmailFunnelAi` facade
- Fully standalone — the only dependency is `illuminate/support`

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

[](#installation)

```
composer require emailfunnelai/laravel
```

Publish the config (optional):

```
php artisan vendor:publish --tag=emailfunnelai-config
```

Set your credentials in `.env`:

```
EMAILFUNNELAI_PROJECT_KEY=pk_your_project_key
EMAILFUNNELAI_PROJECT_SECRET=sk_your_secret_key

# Optional — defaults to https://app.emailfunnel.ai.
# Set only for staging, a self-hosted instance, or local development.
# EMAILFUNNELAI_BASE_URL=http://127.0.0.1:8000
```

Usage
-----

[](#usage)

Via the facade:

```
use EmailFunnelAi\Laravel\Facades\EmailFunnelAi;

EmailFunnelAi::validate();

$list = EmailFunnelAi::lists()->create('Newsletter signups');

EmailFunnelAi::contacts()
    ->sync(['email' => 'jane@example.com', 'source_type' => 'app'])
    ->toList($list['id']);

EmailFunnelAi::analytics()->dashboard();
```

Or resolve the client from the container / inject it:

```
use EmailFunnelAi\Laravel\Client;

public function __construct(private Client $emailFunnel) {}

// ...
$this->emailFunnel->bindings()->all();
```

The full resource surface is `contacts`, `lists`, `bindings`, `fieldMappings`, `autoTagging`, `analytics`, and `sso`, plus a top-level `validate`.

Responses &amp; errors
----------------------

[](#responses--errors)

Successful calls return the unwrapped `data` payload as an array. Any error response raises a typed exception:

```
use EmailFunnelAi\Laravel\Exceptions\ApiException;
use EmailFunnelAi\Laravel\Exceptions\TransportException;

try {
    EmailFunnelAi::contacts()->sync(['email' => 'invalid'])->toList($listId);
} catch (ApiException $e) {
    $e->status;     // 422
    $e->errorType;  // "validation_error"
    $e->messages;   // ['contact.email' => ['The email field is required.']]
    $e->retryAfter; // set on 429 rate limits
} catch (TransportException $e) {
    // network / timeout failure (no HTTP response)
}
```

Branch on `errorType` for specific conditions — e.g. a contact list that has been deactivated rejects new members with a `409 list_inactive`:

```
try {
    EmailFunnelAi::contacts()->sync($contact)->toList($listId);
} catch (ApiException $e) {
    if ($e->errorType === 'list_inactive') {
        // The target list is inactive — reactivate it or pick another list.
    }
}
```

### Common `errorType` values

[](#common-errortype-values)

`errorType`StatusMeaning`invalid_credentials`401Missing/invalid project key or secret`inactive_project`403The connected project is inactive`validation_error`422Request body failed validation (`messages` set)`invalid_email` / `suppressed`422Email is undeliverable or suppressed`list_inactive`409Target contact list is inactive and rejects new members`rate_limit_exceeded`4291000 req/hour cap hit (`retryAfter` set)`sync_failed`500Unexpected sync failureTransport &amp; testing
-----------------------

[](#transport--testing)

By default the package sends requests through Laravel's HTTP client, so `Http::fake()`, retries, logging, and any global middleware apply to SDK calls:

```
use Illuminate\Support\Facades\Http;
use EmailFunnelAi\Laravel\Facades\EmailFunnelAi;

Http::fake([
    '*/api/v1/saas/contacts' => Http::response(['data' => ['contact_id' => 7]], 201),
]);

EmailFunnelAi::contacts()->sync(['email' => 'jane@example.com', 'source_type' => 'app'])->toList($listId);

Http::assertSent(fn ($request) => $request->url() === 'https://app.emailfunnel.ai/api/v1/saas/contacts');
```

Need a different transport (e.g. a zero-dependency cURL client, a PSR-18 client, or custom logging)? Bind your own `EmailFunnelAi\Laravel\Http\HttpClient`:

```
use EmailFunnelAi\Laravel\Http\CurlHttpClient;
use EmailFunnelAi\Laravel\Http\HttpClient;

$this->app->instance(HttpClient::class, new CurlHttpClient());
```

Testing
-------

[](#testing)

```
composer install
composer test
```

Tests use Orchestra Testbench with a recording transport — no network — and a coverage test asserts the facade exposes every documented endpoint.

License
-------

[](#license)

MIT © Email Funnel AI

###  Health Score

9

—

LowBetter than 0% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14246834?v=4)[Ratul Hasan](/maintainers/ratulhasan)[@RatulHasan](https://github.com/RatulHasan)

### Embed Badge

![Health badge](/badges/emailfunnelai-sdk-laravel/health.svg)

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

PHPackages © 2026

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