Looking to hire Laravel developers? Try LaraJobs

campaigns-for-laravel maintained by roundly-consulting

Description
Send campaigns to multiple recipients
Last update
2026/10/03 20:39 (dev-main)
License
Downloads
1

Comments
comments powered by Disqus

Campaigns for Laravel

Send campaigns to many recipients through Laravel queues and job batches. Address them by email, contact record or contact owner, deliver by email, a Laravel notification or your own job, and keep campaigns in memory or in the database.

Installation

Requires PHP 8.4 and Laravel 12 or 13.

composer require roundly-consulting/campaigns-for-laravel
php artisan vendor:publish --tag="campaigns-migrations" --tag="options-migrations" --tag="contacts-migrations"
php artisan migrate

Every campaign runs as a job batch, so the app needs Laravel's job_batches table (php artisan make:queue-batches-table if it has none) and a running queue worker. To follow progress across requests, keep campaigns in the database rather than the default per-process memory: CAMPAIGNS_STORE='RoundlyConsulting\Campaigns\Stores\DatabaseCampaignStore'.

Usage

Create, address and send a campaign through the facade, then follow its progress:

use RoundlyConsulting\Campaigns\Facades\Campaigns;

$campaign = Campaigns::create('Buy today and spend less', '<p>Hello dear customer!</p>')
    ->from('no-reply@eshop.tld', 'Best E-Shop Ever')
    ->to(['john@doe.tld', 'jane@doe.tld'])     // emails, Contact records or HasContacts owners
    ->dispatch();                              // one queued delivery job per recipient

$progress = Campaigns::campaign($campaign->uuid)->progress();

$progress->percentage();                       // share delivered so far: 50.0
$progress->failed;                             // deliveries that failed
$progress->remaining();                        // recipients still to go

Campaigns::cancel($campaign->uuid);            // stop the rest

Documentation

The full documentation — configuration, every feature and its API, and testing — lives on our website: roundly-consulting.com/open-source/docs/campaigns-for-laravel

Release notes are in CHANGELOG.md. To contribute, see the contributing guide.

Support our work

This package is free and open source, built and maintained by Roundly Consulting. If it saves you time, please consider supporting our open-source work — a one-time donation, a monthly pledge on Patreon or a crypto donation helps fund maintenance, new features and new packages.

License

The MIT License (MIT). See LICENSE.md.