lockally / laravel
Official Lockally mail driver for Laravel — send transactional email via Lockally with Mail::mailer('lockally').
v0.1.0
2026-08-05 06:20 UTC
Requires
- php: ^8.1
- illuminate/support: ^10.0 || ^11.0 || ^12.0
- lockally/sdk: ^0.1
- symfony/mailer: ^6.2 || ^7.0
Requires (Dev)
- phpunit/phpunit: ^10.5 || ^11.0
This package is not auto-updated.
Last update: 2026-08-05 19:15:47 UTC
README
Official Lockally mail driver for Laravel. Send transactional email through
Lockally using Laravel's native Mail — mailables,
notifications, and queued mail all work unchanged.
Install
composer require lockally/laravel
The service provider is auto-discovered. Publish the config (optional):
php artisan vendor:publish --tag=lockally-config
Configure
Set your API key:
LOCKALLY_API_KEY=lk_live_xxx # lk_test_xxx runs in sandbox (no real send) MAIL_MAILER=lockally
Add the mailer in config/mail.php:
'mailers' => [ 'lockally' => ['transport' => 'lockally'], ],
Use
Nothing else changes — use Laravel's Mail as usual:
use Illuminate\Support\Facades\Mail; Mail::mailer('lockally')->raw('Your code is 847291.', function ($m) { $m->from('alerts@yourdomain.com') ->to('user@example.com') ->subject('Your OTP code'); });
Mailables, Notification mail channel, and queued mail route through Lockally
automatically once MAIL_MAILER=lockally.
Notes
- Reply-To is delivered via the message headers (Lockally has no separate
reply_tofield). - Attachments are sent inline as base64 (10 MB per attachment). Inline/CID images are sent as regular attachments.
- Each send carries a generated
Idempotency-Key.
Built on the official lockally/sdk
PHP client.
License
MIT