basementdevs / filament-better-mails
This is my package filament-better-mails
Package info
github.com/basementdevs/filament-better-mail
pkg:composer/basementdevs/filament-better-mails
Fund package maintenance!
Requires
- php: ^8.3
- filament/filament: ^5.0
- illuminate/contracts: ^12.0
- resend/resend-laravel: ^0.22.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- driftingly/rector-laravel: ^2.0.4
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.0.0||^9.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-livewire: ^4.0
- rector/rector: ^2.0.15
This package is auto-updated.
Last update: 2026-02-27 21:38:16 UTC
README
A Laravel package that provides a complete implementation to track mails, starting to send the mail and receiving back mail's events by webhooks, currently the supported mailer is Resend, and a Filament v4 resource to view sent mails in your admin panel. It ships with:
Overview of the stack
- Language: PHP 8.3
- Framework: Laravel (Illuminate 12.x APIs)
- Admin: Filament v4
- Package manager: Composer
- Testing: Pest + Orchestra Testbench
Requirements
- PHP ^8.3
- Laravel 12.x compatible application
- Filament ^4.0 installed in the host app
- Composer
Installation
You can install the package via composer:
composer require basementdevs/filament-better-mails
You can publish and run the migrations with:
php artisan vendor:publish --tag="filament-better-mails-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="filament-better-mails-config"
This is the contents of the published config file:
return [ 'mails' => [ 'models' => [ 'mail' => BetterEmail::class, 'event' => BetterEmailEvent::class, 'attachment' => BetterEmailAttachment::class, ], 'database' => [ 'tables' => [ 'mails' => 'mails', 'attachments' => 'mail_attachments', 'events' => 'mail_events', 'polymorph' => 'mailables', ], 'pruning' => [ 'enabled' => false, 'after' => 30, // days ], ], 'headers' => [ 'key' => 'X-Better-Mails-Event-ID' ], 'logging' => [ 'attachments' => [ 'enabled' => env('MAILS_LOGGING_ATTACHMENTS_ENABLED', true), 'disk' => env('FILESYSTEM_DISK', 'local'), 'root' => 'mails/attachments', ], ] ], 'webhooks' => [ 'provider' => env('MAILS_WEBHOOK_PROVIDER', 'resend'), 'drivers' => [ 'resend' => [ 'driver' => ResendDriver::class, 'key_secret' => env('RESEND_WEBHOOK_SECRET', ''), ], ] ] ];
Environment variables
Resend credentials and defaults are required by your application. The following are commonly used; verify in your project:
MAIL_MAILER=resend RESEND_API_KEY= RESEND_WEBHOOK_SECRET=
Optionally, you can publish the views using
php artisan vendor:publish --tag="filament-better-mails-views"
Usage
To use the Filament Resource you must add the FilamentBetterEmailPlugin at your panel provider.
use Basement\BetterMails\Filament\FilamentBetterEmailPlugin; ->plugins([ FilamentBetterEmailPlugin::make(), ])
The resource track all mails sent based on their status, also has a widget and actions to resend this mails again.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.