PHPackages                             senderkit/senderkit-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. [Mail &amp; Notifications](/categories/mail)
4. /
5. senderkit/senderkit-laravel

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

senderkit/senderkit-laravel
===========================

Laravel integration for the SenderKit PHP SDK — service provider, facade, mail transport, notification channel, webhook middleware.

v0.2.0(1mo ago)01MITPHPPHP &gt;=8.1

Since Jun 11Pushed 1mo agoCompare

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

READMEChangelogDependencies (12)Versions (3)Used By (0)

SenderKit for Laravel
=====================

[](#senderkit-for-laravel)

Laravel integration for the [SenderKit PHP SDK](https://github.com/senderkit/senderkit-sdk-php).

Install
-------

[](#install)

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

Set `SENDERKIT_API_KEY` (and optionally `SENDERKIT_WEBHOOK_SECRET`) in `.env`.

Usage
-----

[](#usage)

Prefer **SenderKit templates** over raw content: templates are versioned, previewable, and editable in SenderKit without a deploy, and you get per-template analytics. Raw sends (`sendRaw`, or anything routed through Laravel Mail) lose all of that.

```
use SenderKit\Laravel\Facades\SenderKit;
use SenderKit\Request\TemplateSend;

SenderKit::send(new TemplateSend(template: 'welcome', to: $user->email, vars: ['name' => $user->name]));

SenderKit::messages()->list();
SenderKit::templates()->list();
```

Or inject `SenderKit\Client` anywhere via the container.

Notification channel (recommended)
----------------------------------

[](#notification-channel-recommended)

The `senderkit` channel sends template-based notifications. Return a `SenderKitMessage` from `toSenderKit()` — the recipient is resolved from the notifiable's `senderkit` route, falling back to its `mail` route (so a `User`with an `email` works out of the box):

```
use Illuminate\Notifications\Notification;
use SenderKit\Laravel\Notifications\SenderKitMessage;

class OrderShipped extends Notification
{
    public function __construct(private Order $order) {}

    public function via(object $notifiable): array
    {
        return ['senderkit'];
    }

    public function toSenderKit(object $notifiable): SenderKitMessage
    {
        return SenderKitMessage::template('order-shipped')
            ->vars(['order_id' => $this->order->id, 'name' => $notifiable->name]);
    }
}
```

The channel is template-only by design. `SenderKitMessage` also supports `version()`, `channel()`, `metadata()`, `scheduledAt()`, `cc()`, `bcc()`, `replyTo()`, `attachments()`, `idempotencyKey()`, and `to()`.

### SMS, push, and web push

[](#sms-push-and-web-push)

Set the message's channel and give the notifiable a `senderkit` route. The route is either a string (used for any channel) or a map keyed by channel:

```
use SenderKit\Enum\Channel;

// On the notifiable:
public function routeNotificationForSenderkit(): array
{
    return [
        'email' => $this->email,
        'sms' => $this->phone,
        'push' => $this->device_token,
        'web-push' => $this->web_push_subscription,
    ];
}

// In the notification:
public function toSenderKit(object $notifiable): SenderKitMessage
{
    return SenderKitMessage::template('otp')
        ->channel(Channel::Sms)
        ->vars(['code' => $this->code]);
}
```

Email messages fall back to the notifiable's `mail` route, so a plain `User`works without any extra setup; SMS, push, and web push require a `senderkit`route (or an explicit `->to()`) and are skipped when none is present.

`toSenderKit()` may also return a list of messages to notify on several channels at once:

```
public function toSenderKit(object $notifiable): array
{
    return [
        SenderKitMessage::template('order-shipped')->vars($vars), // email
        SenderKitMessage::template('order-shipped')->vars($vars)->channel(Channel::Push),
    ];
}
```

Mail transport (for existing Mailables)
---------------------------------------

[](#mail-transport-for-existing-mailables)

The `senderkit` mail transport lets an existing Mailable-based app deliver through SenderKit without code changes. Add a mailer to `config/mail.php`:

```
'mailers' => [
    'senderkit' => ['transport' => 'senderkit'],
],
```

and set `MAIL_MAILER=senderkit`. Existing `Mail::to(...)->send(...)` calls, queued mail, and `mail`-channel notifications now go through SenderKit.

Note: Laravel renders Mailables to HTML locally, so the transport uses raw sends — those messages bypass SenderKit templates (no versioning, preview, or per-template analytics). It's the right tool for migrating; for new code, prefer the notification channel or `TemplateSend` above. Emails with multiple `to` recipients are sent as one API call per recipient.

Webhooks
--------

[](#webhooks)

```
use SenderKit\Laravel\Http\Middleware\VerifyWebhookSignature;

Route::post('/webhooks/senderkit', function (Request $request) {
    $event = $request->attributes->get('senderkit_event'); // SenderKit\Webhook\WebhookEvent
    // ...
})->middleware(VerifyWebhookSignature::class);
```

Invalid signatures get a 400; a missing `senderkit.webhook_secret` config yields a 500.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance90

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity33

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

Every ~0 days

Total

2

Last Release

45d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/217d79b2ef3dda6048f6368e331106b1d6321be4af345642f6f6b66bf8c7161b?d=identicon)[tuyakhov](/maintainers/tuyakhov)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[illuminate/notifications

The Illuminate Notifications package.

483.1M1.2k](/packages/illuminate-notifications)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k30.2M151](/packages/laravel-cashier)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[spatie/laravel-health

Monitor the health of a Laravel application

87912.0M177](/packages/spatie-laravel-health)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M7](/packages/propaganistas-laravel-disposable-email)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M250](/packages/laravel-ai)

PHPackages © 2026

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