PHPackages                             charlielangridge/filament-mail-previewer - 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. charlielangridge/filament-mail-previewer

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

charlielangridge/filament-mail-previewer
========================================

Filament Mail Previewer - allows you to preview mailables and notifications in Filament

v0.2.1(2mo ago)0639↓40.1%[1 PRs](https://github.com/charlielangridge/filament-mail-previewer/pulls)MITPHPPHP ^8.3CI passing

Since Feb 25Pushed 1w agoCompare

[ Source](https://github.com/charlielangridge/filament-mail-previewer)[ Packagist](https://packagist.org/packages/charlielangridge/filament-mail-previewer)[ Docs](https://github.com/charlielangridge/filament-mail-previewer)[ GitHub Sponsors](https://github.com/charlielangridge)[ RSS](/packages/charlielangridge-filament-mail-previewer/feed)WikiDiscussions 5.x Synced yesterday

READMEChangelog (3)Dependencies (26)Versions (7)Used By (0)

Filament Mail Previewer
=======================

[](#filament-mail-previewer)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d99f304e2a350ddf6ef60eabaf912a97ebd6b4b62924134d086092b5eff65b02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636861726c69656c616e6772696467652f66696c616d656e742d6d61696c2d7072657669657765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/charlielangridge/filament-mail-previewer)[![GitHub Tests Action Status](https://camo.githubusercontent.com/6ebde7554c5b92760dcd6234c87e47bf7246b66796d16eba1206e5433a9e343a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636861726c69656c616e6772696467652f66696c616d656e742d6d61696c2d7072657669657765722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/charlielangridge/filament-mail-previewer/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0826bb175d7ae1c9dbd2f2ac21f3186b52970524be10288fbe620b2886694f82/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636861726c69656c616e6772696467652f66696c616d656e742d6d61696c2d7072657669657765722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/charlielangridge/filament-mail-previewer/actions?query=workflow%3A%22Fix+PHP+code+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b1b64f43517383a776e9bcb663d76097c908a333af6dadf632273474dcdca664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636861726c69656c616e6772696467652f66696c616d656e742d6d61696c2d7072657669657765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/charlielangridge/filament-mail-previewer)

Filament Mail Previewer adds a Filament page that discovers your app mailables and notifications, asks for any required constructor inputs, and renders the email HTML side-by-side in desktop and mobile frames.

It uses [`charlielangridge/laravel-mail-previewer`](https://packagist.org/packages/charlielangridge/laravel-mail-previewer) under the hood to discover classes and render previews.

Requirements
------------

[](#requirements)

- PHP `^8.3`
- Laravel app with Filament `^5.0`
- A Filament panel where you can register plugins

Installation
------------

[](#installation)

Install the package:

```
composer require charlielangridge/filament-mail-previewer
```

The package auto-discovers its service provider.

Register The Plugin In Your Filament Panel
------------------------------------------

[](#register-the-plugin-in-your-filament-panel)

Add the plugin to your panel provider (example: `app/Providers/Filament/AdminPanelProvider.php`):

```
use CharlieLangridge\FilamentMailPreviewer\FilamentMailPreviewerPlugin;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugins([
            FilamentMailPreviewerPlugin::make(),
        ]);
}
```

This registers:

- a navigation page: `Mail Previewer`
- a preview page used after selecting a mailable/notification

Filament Theme Setup (Important)
--------------------------------

[](#filament-theme-setup-important)

If you are using a custom Filament theme, include this package's Blade files in your Tailwind content sources so page styles/classes are picked up:

```
@source '../../../../vendor/charlielangridge/filament-mail-previewer/resources/**/*.blade.php';
```

Then rebuild your assets.

If you have not created a custom Filament theme yet, follow the Filament docs first:

-

Optional Configuration
----------------------

[](#optional-configuration)

Publish config if you want to override the facade class used to talk to the underlying Laravel mail previewer package:

```
php artisan vendor:publish --tag="filament-mail-previewer-config"
```

Published config:

```
return [
    'laravel_mail_previewer_facade' => \Charlielangridge\LaravelMailPreviewer\Facades\LaravelMailPreviewer::class,
    'authorization' => [
        'mode' => 'none',
        'gate_ability' => 'viewFilamentMailPreviewer',
        'policy' => [
            'model' => null,
            'ability' => 'viewAny',
        ],
        'callback' => null,
    ],
];
```

In most apps you do not need to change this.

Authorization (Optional)
------------------------

[](#authorization-optional)

By default, access is open to users who can access your panel (`authorization.mode = none`).

You can restrict the plugin using one of the following approaches.

### Gate-based authorization

[](#gate-based-authorization)

Set:

```
'authorization' => [
    'mode' => 'gate',
    'gate_ability' => 'viewFilamentMailPreviewer',
],
```

Then define the gate in your app (example in `AuthServiceProvider`):

```
Gate::define('viewFilamentMailPreviewer', fn (User $user): bool => $user->is_admin);
```

### Policy-based authorization

[](#policy-based-authorization)

Set:

```
'authorization' => [
    'mode' => 'policy',
    'policy' => [
        'model' => \App\Support\MailPreviewerAccess::class,
        'ability' => 'viewAny',
    ],
],
```

Then register a policy for that model and implement the ability:

```
class MailPreviewerAccessPolicy
{
    public function viewAny(User $user): bool
    {
        return $user->is_admin;
    }
}
```

### Callback authorization

[](#callback-authorization)

Use a config callback:

```
'authorization' => [
    'callback' => fn (?Authenticatable $user): bool => (bool) $user?->is_admin,
],
```

Or define it directly in your panel plugin registration:

```
FilamentMailPreviewerPlugin::make()
    ->authorizeUsing(fn (?Authenticatable $user): bool => (bool) $user?->is_admin);
```

When a callback is set, it takes precedence over `mode`.

Usage
-----

[](#usage)

1. Open your Filament panel.
2. Go to `Mail Previewer` in navigation.
3. Select a mailable or notification row and click `Preview`.
4. Fill required inputs in the modal.
5. Submit to open the rendered email preview page.

The preview page shows:

- desktop frame
- mobile frame
- heading + resolved subject

How Inputs Are Handled
----------------------

[](#how-inputs-are-handled)

The plugin automatically builds a form from discovered constructor/input requirements:

- `model` inputs become searchable selects
- `array` inputs are entered as JSON
- `integer` inputs are numeric fields
- fields with `date` in the name become date pickers
- other values are captured in textareas

For notifications, a `notifiable` model input is added automatically when possible (usually defaults to the authenticated user in the modal).

Troubleshooting
---------------

[](#troubleshooting)

If the table is empty or you see the install notice:

- ensure `charlielangridge/laravel-mail-previewer` is installed (it is a dependency of this plugin)
- ensure your mailables/notifications are discoverable in your app
- clear caches and reload:

```
php artisan optimize:clear
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

Contributing
------------

[](#contributing)

See [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md).

Security
--------

[](#security)

See [.github/SECURITY.md](.github/SECURITY.md).

Credits
-------

[](#credits)

- [Charlie Langridge](https://github.com/charlielangridge)

License
-------

[](#license)

MIT. See [LICENSE.md](LICENSE.md).

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance92

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 64.3% 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 ~18 days

Total

4

Last Release

73d ago

Major Versions

v0.2.1 → 5.x-dev2026-04-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/f4c3198a248b9580414af6bd9a09b66c8307b409de14b5bbec32140974323474?d=identicon)[charlielangridge](/maintainers/charlielangridge)

---

Top Contributors

[![charlielangridge](https://avatars.githubusercontent.com/u/8578083?v=4)](https://github.com/charlielangridge "charlielangridge (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelfilamentfilament-pluginfilamentphpcharlielangridgefilament-mail-previewer

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/charlielangridge-filament-mail-previewer/health.svg)

```
[![Health](https://phpackages.com/badges/charlielangridge-filament-mail-previewer/health.svg)](https://phpackages.com/packages/charlielangridge-filament-mail-previewer)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

274325.8k8](/packages/croustibat-filament-jobs-monitor)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6649.5k1](/packages/marcelweidum-filament-passkeys)[backstage/mails

View logged mails and events in a beautiful Filament UI.

16120.0k](/packages/backstage-mails)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17760.2k3](/packages/stephenjude-filament-jetstream)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84215.9k9](/packages/stephenjude-filament-two-factor-authentication)

PHPackages © 2026

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