Introducing Laravel Sent dm — Multi-Channel Messaging for Laravel
# Introducing laravel-sent-dm
The Laravel ecosystem is built on a culture of expressive, elegant packages.
When I needed to integrate Sent.dm's unified messaging API into a client
project, I went looking for a Laravel adapter.
There wasn't one. So I built it.
## What is Sent.dm?
Sent.dm is a unified messaging API that auto-routes messages across SMS,
WhatsApp, and RCS. It prefers WhatsApp when available and falls back to SMS
— all through a single API call. It handles contact management, templates,
webhooks, number lookup, and multi-profile tenancy.
It is a genuinely well-designed API. It deserved a first-class Laravel
integration.
## What laravel-sent-dm provides
Fluent message builder
use Sujip\SentDm\Facades\Sent;
Sent::to('+61412345678')
->message('Your order has been shipped!')
->send();
Every method returns a clone — the builder is fully immutable.
## Laravel Notifications channel
use Sujip\SentDm\Channels\SentChannel;
use Sujip\SentDm\Messages\SentMessage;
class OrderShipped extends Notification
{
public function via(object $notifiable): array
{
return [SentChannel::class];
}
public function toSent(object $notifiable): SentMessage
{
return SentMessage::create()
->message('Your order has been shipped!');
}
}
## Queue-backed by default
Every send dispatches a SendSentMessage job. Nothing blocks the request cycle. Retry with exponential backoff is built in. Jobs dispatch after database commit — always.
Webhook engine
The package ships a complete webhook engine:
- Opt-in route via config — never auto-registered
- HMAC-SHA256 signature verification at middleware level
- Replay protection via 5-minute timestamp window
- Typed Laravel Events for all 7 webhook sub-types:
message.queued,.routed,.sent,.delivered,.read,.failed,.received
## Bulk dispatch
Sent::bulk($users)->template('promo_template')->dispatch();
Uses Laravel's native job batching under the hood.
HasSentContract trait
class User extends Model
{
use HasSentContact;
}
$user->sendSentMessage('Hello from Laravel!');
Sent::fake();
// trigger your code
Sent::assertSent(function (SentMessage $message) {
return $message->getTo() === '+61412345678';
});
## Multi-tanant driver pattern
Configured identically to Laravel Mail and Cache. Swap Sent.dm profiles per tenant at runtime with zero architecture changes.
## Installation
composer require sudiptpa/laravel-sent-dm
php artisan sent:install
## Why i built this
I have been writing Laravel applications since version 4 in 2014. This package is built to the standard I would expect from any first-party package — strict types, PHP 8.2+, Laravel 11+, full test coverage, immutable builders, no silent exception swallowing.
The Sent.dm API is solid. The Laravel community deserves a solid integration for it.
## Links
- GitHub: sudiptpa/laravel-sent-dm
- Packagist: sudiptpa/laravel-sent-dm
Stars, feedback, and contributions are very welcome. If you are building on Laravel and need multi-channel messaging, give it a try.