PHPackages                             wezlo/filament-modal-notifications - 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. wezlo/filament-modal-notifications

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

wezlo/filament-modal-notifications
==================================

Render any Filament notification as a blocking modal by chaining -&gt;asModal() onto the native Notification API.

1.0.0(1mo ago)3266↓16.7%1MITPHPPHP ^8.2

Since Apr 24Pushed 1mo agoCompare

[ Source](https://github.com/mustafakhaleddev/filament-modal-notifications)[ Packagist](https://packagist.org/packages/wezlo/filament-modal-notifications)[ RSS](/packages/wezlo-filament-modal-notifications/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Filament Modal Notifications
============================

[](#filament-modal-notifications)

Render any Filament notification as a blocking modal by chaining one method: `->asModal()`. Multiple modal notifications fired in the same request are queued one at a time — the user dismisses one and the next slides in, no stacking.

Everything else you already know about Filament notifications (title, body, icon, color, actions, `danger()`/`success()`/`warning()`/`info()`) carries over unchanged.

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

[](#requirements)

- PHP 8.2+
- Laravel 11+ / 13
- Filament 4 or 5

Features
--------

[](#features)

- **One-line opt-in** — chain `->asModal()` onto any `Notification::make()` call. No new classes to learn.
- **Queued** — multiple modal notifications show one at a time, dismissal advances to the next.
- **Auto-added Close button** — if the developer didn't declare actions, the modal gets a "Close" button in its footer so it's always dismissible.
- **Respects your actions** — if you declare `->actions([...])`, those render in the footer instead.
- **Conditional** — `->asModal($isCritical)` is a no-op when the condition is false, so the notification sends as a regular toast.
- **Independent of the toast tray** — modal notifications never briefly flash as toasts; they use a dedicated session key and Livewire event.
- **Plugin-level defaults** — set the default modal width, closable behavior, and close button label per panel.

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

[](#installation)

```
composer require wezlo/filament-modal-notifications
```

Register the plugin on your panel so the Livewire component mounts at the page footer:

```
use Wezlo\FilamentModalNotifications\FilamentModalNotificationsPlugin;

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

Optionally publish the config:

```
php artisan vendor:publish --tag=filament-modal-notifications-config
```

Quick Start
-----------

[](#quick-start)

```
use Filament\Notifications\Notification;

Notification::make()
    ->title('Changes not saved')
    ->body('Your unsaved edits will be lost if you leave this page.')
    ->danger()
    ->asModal()
    ->send();
```

That's it. On the next Livewire cycle, a modal opens with the title, body, and a default Close button. Regular toasts still work exactly as before — only notifications with `->asModal()` go through the modal pipeline.

Usage
-----

[](#usage)

### With custom actions

[](#with-custom-actions)

The notification's actions render in the modal footer:

```
use Filament\Actions\Action;
use Filament\Notifications\Notification;

Notification::make()
    ->title('Delete this order?')
    ->body('This cannot be undone.')
    ->warning()
    ->actions([
        Action::make('cancel')->label('Cancel')->color('gray')->close(),
        Action::make('delete')->label('Delete')->color('danger')
            ->action(fn () => $this->record->delete())
            ->close(),
    ])
    ->asModal()
    ->send();
```

When any action's `->close()` is invoked (or the user clicks X / Esc / clicks outside if closable), the queue advances to the next pending modal notification.

### Conditional modal

[](#conditional-modal)

`->asModal(false)` leaves the notification as a normal toast:

```
Notification::make()
    ->title($wasCritical ? 'Error' : 'Saved')
    ->asModal($wasCritical)
    ->send();
```

### Queued — multiple in one request

[](#queued--multiple-in-one-request)

```
Notification::make()->title('Step 1 complete')->asModal()->send();
Notification::make()->title('Step 2 complete')->asModal()->send();
Notification::make()->title('Step 3 complete')->asModal()->send();
```

The user sees one modal at a time in FIFO order. Each dismissal advances to the next. When the queue is empty the modal closes.

### Panel-level defaults

[](#panel-level-defaults)

```
use Filament\Support\Enums\Width;
use Wezlo\FilamentModalNotifications\FilamentModalNotificationsPlugin;

->plugins([
    FilamentModalNotificationsPlugin::make()
        ->defaultWidth(Width::Large)
        ->defaultClosable(false)        // block Esc / click-away / X — require an explicit action
        ->defaultCloseButtonLabel('Dismiss'),
])
```

MethodTypeDefaultDescription`defaultWidth(Width|string)`enum/string`md`Modal width (`sm`, `md`, `lg`, `xl`, `2xl`, …, `screen`)`defaultClosable(bool)`bool`true`Whether the modal can be dismissed via X, Esc, or click-away`defaultCloseButtonLabel(string)`string`Close`Label for the auto-added Close actionDefault Config File
-------------------

[](#default-config-file)

```
// config/filament-modal-notifications.php
return [
    'default_width' => 'md',
    'default_closable' => true,
    'default_close_label' => 'Close',
];
```

How It Works
------------

[](#how-it-works)

- **`->asModal()` is a macro** registered on `Filament\Notifications\Notification` in the service provider. It returns a `Wezlo\FilamentModalNotifications\ModalNotification` — a subclass that overrides `send()` to push into a dedicated session key (`filament.modal-notifications`) instead of the default `filament.notifications`.
- **A custom dehydrate hook** dispatches the `modalNotificationsSent` Livewire event when the modal session key has pending notifications (same pattern Filament uses for its toast tray).
- **A Livewire component** (`Wezlo\FilamentModalNotifications\Livewire\ModalNotifications`) mounts at `PanelsRenderHook::BODY_END`. It listens for `modalNotificationsSent`, drains the session key into an in-component queue, and renders the first pending notification through ``. When the user dismisses the modal (X, Esc, click-away, or any action chained with `->close()`), the component advances to the next queued notification.
- **No toast flash** — because modal notifications use a separate session key, the default toast tray never sees them.

License
-------

[](#license)

MIT

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance90

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

46d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25182746?v=4)[Mustafa Khaled](/maintainers/mustafakhaleddev)[@mustafakhaleddev](https://github.com/mustafakhaleddev)

---

Top Contributors

[![mustafakhaleddev](https://avatars.githubusercontent.com/u/25182746?v=4)](https://github.com/mustafakhaleddev "mustafakhaleddev (2 commits)")

---

Tags

laravelnotificationmodalfilament

### Embed Badge

![Health badge](/badges/wezlo-filament-modal-notifications/health.svg)

```
[![Health](https://phpackages.com/badges/wezlo-filament-modal-notifications/health.svg)](https://phpackages.com/packages/wezlo-filament-modal-notifications)
```

###  Alternatives

[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[stephenjude/filament-jetstream

A Laravel starter kit built with Filament inspired by Jetstream.

17758.9k2](/packages/stephenjude-filament-jetstream)[stephenjude/filament-two-factor-authentication

Filament Two Factor Authentication: Google 2FA + Passkey Authentication

84192.9k7](/packages/stephenjude-filament-two-factor-authentication)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6643.3k](/packages/marcelweidum-filament-passkeys)[finity-labs/fin-mail

A powerful email template manager and composer for Filament with dynamic token replacement, template versioning, and inline email sending.

102.7k](/packages/finity-labs-fin-mail)[mradder/filament-logger

Audit logging, activity tracking, exports, alerts, and dashboards for Filament admin panels.

2210.5k](/packages/mradder-filament-logger)

PHPackages © 2026

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