PHPackages                             trigger-engage/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. trigger-engage/laravel

ActiveLibrary

trigger-engage/laravel
======================

Laravel SDK for trigger-engage — event-driven messaging automations (open-source Customer.io alternative).

v0.2.0(1mo ago)0481MITPHPPHP ^8.2

Since Jul 12Pushed 1mo agoCompare

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

READMEChangelogDependencies (6)Versions (2)Used By (1)

trigger-engage Laravel SDK
==========================

[](#trigger-engage-laravel-sdk)

Fire events from your Laravel app into a [trigger-engage](../server) server, where drag-and-drop automations turn them into email, SMS, and push messages.

Fail-open by design: SDK calls never throw into your application code — a trigger-engage outage can't break your signup or payment flows.

Part of **[TriggerEngage](https://triggerengage.com)**, open-source lifecycle messaging for Laravel. New to event-driven messaging? Start with [how to send event-based emails in Laravel](https://triggerengage.com/blog/event-based-emails-laravel.html).

Install
-------

[](#install)

```
composer require trigger-engage/laravel
php artisan vendor:publish --tag=trigger-engage-config
```

If the complete `trigger-engage/server` package is installed in the same Laravel application, it provides this SDK automatically and replaces the HTTP transport with an in-process dispatcher. No endpoint or API credentials are needed in that embedded mode.

Initialize
----------

[](#initialize)

Initialization requires the **combination of your workspace id and an API key**(created in the trigger-engage dashboard). Requests authenticate with HTTP Basic auth — workspace id as username, API key as password — so a leaked key is useless against another workspace.

```
TRIGGER_ENGAGE_ENDPOINT=https://engage.your-domain.com
TRIGGER_ENGAGE_WORKSPACE_ID=ws_01hxyz...
TRIGGER_ENGAGE_API_KEY=te_...
```

Usage
-----

[](#usage)

```
use TriggerEngage\Laravel\Facades\TriggerEngage;

// Upsert a person profile (who messages get sent to)
TriggerEngage::identify('user-42', [
    'email' => $user->email,
    'first_name' => $user->first_name,
    'phone' => $user->phone,
    'type' => 'user',
]);

// Merge typed profile properties (numbers, booleans, strings, arrays, or objects)
TriggerEngage::setProperties('user-42', [
    'appointments' => 4,
    'plan' => 'wellness',
    'active' => true,
]);

// Track an event — this is what triggers automations
TriggerEngage::event('customer_sign_up', ['plan' => 'free'], person: 'user-42');

// Add/remove a person to a MANUAL segment (event-driven and rule-based
// segments manage their own membership and are not changed from the SDK)
TriggerEngage::addToSegment('seg_01...', 'user-42');
TriggerEngage::removeFromSegment('seg_01...', 'user-42');
```

### Anonymous → identified

[](#anonymous--identified)

Track people before you know who they are with an `anonymous_id`, then merge that history when they sign up. See the [anonymous identity guide](../server/docs/guides/anonymous-identity.md).

```
// Before signup — an anonymous event keyed by a device/session id
TriggerEngage::event('pricing_view', ['path' => '/pricing'], anonymousId: 'device-abc');

// On signup — folds the anonymous profile (events, attributes, memberships) into user-42
TriggerEngage::identify('user-42', ['email' => $user->email], anonymousId: 'device-abc');
```

Both parameters are optional and backward compatible. An event needs **either** a `person`/`personId` **or** an `anonymousId`; if both are missing, the fail-open SDK logs and skips the call instead of sending an unusable event or throwing.

Calls are queued by default (`TRIGGER_ENGAGE_DISPATCH=sync` to send inline). Each call carries an idempotency key minted at call time, so queue retries can never double-trigger an automation.

Testing
-------

[](#testing)

```
$fake = TriggerEngage::fake();

// ... run the code under test ...

$fake->assertEventSent('customer_sign_up', fn ($data, $person) => $person === 'user-42');
$fake->assertIdentified('user-42');
$fake->assertEventSentTimes('customer_sign_up', 1);
$fake->assertEventNotSent('wallet_funded');
$fake->assertNothingSent();
```

Learn more
----------

[](#learn-more)

- **Website:** [triggerengage.com](https://triggerengage.com)
- **Guides:** [event-based emails in Laravel](https://triggerengage.com/blog/event-based-emails-laravel.html) · [building a notification system in Laravel](https://triggerengage.com/blog/notification-system-laravel.html)

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity36

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

50d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/44205918?v=4)[Oluwaseun Raphael Afolayan](/maintainers/theafolayan)[@theafolayan](https://github.com/theafolayan)

---

Top Contributors

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

---

Tags

laravelautomationmessagingtrigger-engagecustomer-io

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/trigger-engage-laravel/health.svg)

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

###  Alternatives

[laravel/scout

Laravel Scout provides a driver based solution to searching your Eloquent models.

1.7k59.5M712](/packages/laravel-scout)[nuwave/lighthouse

A framework for serving GraphQL from Laravel

3.5k12.6M131](/packages/nuwave-lighthouse)[illuminate/auth

The Illuminate Auth package.

10528.8M1.4k](/packages/illuminate-auth)[illuminate/broadcasting

The Illuminate Broadcasting package.

7227.7M254](/packages/illuminate-broadcasting)[psalm/plugin-laravel

Psalm plugin for Laravel

3365.5M359](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k17.6M165](/packages/laravel-pulse)

PHPackages © 2026

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