Download the PHP package ismail-rt/laravel-atlas-drip without Composer
On this page you can find all versions of the php package ismail-rt/laravel-atlas-drip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-atlas-drip
Laravel Atlas Drip
A headless, state-driven lifecycle & drip campaign engine for Laravel with zero double-sends, automatic cooldowns, and jitter-proof timing.
Built for Laravel SaaS developers, indie hackers, and engineering teams needing robust, code-defined onboarding and retention drip campaigns without paying $200–$1,000/mo for external SaaS marketing tools (Customer.io, Braze, Iterable).
Table of Contents
- The Problem: Why Naive Drip Logic Fails
- How Laravel Atlas Drip Solves It (Architecture & Flow)
- Campaign State Machine
- The Two-Clock Formula
- Signed Unsubscribe Flow
- Installation
- Configuration
- Defining Campaigns
- Artisan Commands
- Events & Observability
- Running Tests
- License
The Problem: Why Naive Drip Logic Fails
Almost every developer writing scheduled emails starts with this naive approach:
In production, this pattern causes 6 critical failures:
- The "Catch-Up Blast" (First Deploy Disaster): Deploying this logic to an existing database with 50,000 users causes all 50,000 users to receive Day 3, Day 5, and Day 7 emails simultaneously on the first cron run.
- The "Cron Lag Compression" Bug: If a queue backs up or cron is paused for 4 days, both Day 3 and Day 5 milestones become overdue. On the next run, the user receives both emails back-to-back.
- Double-Sends via Race Conditions: In multi-worker setups, two workers pick up the same batch and email the same user twice within milliseconds without atomic database-level deduplication.
- Cross-Campaign Inbox Bombing: A user triggers Onboarding, Win-Back, and Feature Announcement campaigns on the same day. Without a global cooldown, they receive 3 marketing emails in one afternoon.
- The Zombie Campaign (Ignored Goal Completion): A user signs up, verifies email, and immediately pays for an annual plan. Three days later, naive cron sends: "Hey! Why haven't you explored our app yet?"
- Entangled Unsubscribes: Users clicking "unsubscribe" on a marketing drip get opted out of critical transactional emails (password resets, invoices, security alerts) because there is no separate lifecycle opt-out ledger.
How Laravel Atlas Drip Solves It (Architecture & Flow)
Laravel Atlas Drip evaluates recipients through a strict State Machine + Atomic Deduplication + Two-Clock Pipeline:
Campaign State Machine
Each recipient journey is tracked as an explicit, tamper-proof state machine stored in lad_campaign_states:
active: The recipient is moving through sequential steps.completed: All configured steps have been successfully dispatched.cancelled: The user reached the campaign's conversion goal (e.g. upgraded to paid plan) or opted out. Terminal states never re-enroll or restart.
The Two-Clock Formula
When evaluating whether a sequential step is due, the engine computes:
Why this matters: If Day 3 email sends on Day 4 due to a queue outage, and Day 5 has a minimumGapDays(2), Step 2 will not send on Day 5. It automatically waits until at least Day 6.
Signed Unsubscribe Flow
Laravel Atlas Drip isolates marketing opt-outs from transactional emails (invoices, password resets, security alerts) with a built-in cryptographic HMAC flow:
Installation
Install the package via Composer:
Publish and run the database migrations:
Optionally publish the configuration file and views:
Configuration (config/lad.php)
Defining Campaigns
Register campaigns in your AppServiceProvider or a dedicated service provider using the fluent builder. You can import any of the available facades (Drip, Lifecycle, or Lad):
Flexible Step Offsets & Gaps
Step timings support days, hours, and minutes:
Artisan Commands
1. Dispatch Due Emails (drip:send / lad:send)
Schedule this command in routes/console.php to run hourly:
Command options:
2. Inspect Recipient Status (drip:status / lad:status)
Diagnose recipient eligibility, cooldown window, active campaign states, and upcoming step dates:
Example tabular output:
3. Manually Cancel Campaign (drip:cancel / lad:cancel)
Manually transition campaign states to cancelled for a recipient:
Events & Observability
Laravel Atlas Drip dispatches standard Laravel events for metrics, analytics, or logging:
| Event | Dispatched When | Payload |
|---|---|---|
Lad\Events\CampaignEnrolled |
Recipient enters a new campaign | $recipient, $campaign, $state |
Lad\Events\StepDispatched |
Step notification is sent | $recipient, $campaign, $step, $state, $log |
Lad\Events\CampaignCompleted |
Final step is sent | $recipient, $campaign, $state |
Lad\Events\CampaignCancelled |
Goal reached or user opted out | $recipient, $campaign, $state, $reason |
Listen to events in your EventServiceProvider or AppServiceProvider:
Running Tests
Run the complete test suite with Pest:
License
The MIT License (MIT). Please see License File for more information.