PHPackages                             agencetwogether/filament-alert-box - 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. [Admin Panels](/categories/admin)
4. /
5. agencetwogether/filament-alert-box

ActiveLibrary[Admin Panels](/categories/admin)

agencetwogether/filament-alert-box
==================================

Define and display contextual alerts anywhere on your admin panel pages — Resources, custom Pages — using Filament's native render hooks system

1.1.0(3w ago)6247—9.3%1MITPHPPHP ^8.3CI passing

Since May 10Pushed 3w agoCompare

[ Source](https://github.com/agencetwogether/filament-alert-box)[ Packagist](https://packagist.org/packages/agencetwogether/filament-alert-box)[ Docs](https://github.com/agencetwogether/filament-alert-box)[ GitHub Sponsors](https://github.com/agencetwogether)[ RSS](/packages/agencetwogether-filament-alert-box/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (11)Versions (3)Used By (0)

[![filament-alert-box-art](previews/filament-alert-box.jpg)](https://github.com/agencetwogether/filament-alert-box) [ ![FILAMENT 4.x](https://camo.githubusercontent.com/13befbe0cffd101b2484ce1cdd985dabcddcbf1176d17a675674d53af99cfdbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46494c414d454e542d342e782d4542423330343f7374796c653d666f722d7468652d6261646765) ](https://filamentphp.com/docs/4.x/introduction/installation) [ ![FILAMENT 5.x](https://camo.githubusercontent.com/3ec960aa304b803da9f1192f01e82da976a3d220ea85931fec930003e0532c77/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46494c414d454e542d352e782d4542423330343f7374796c653d666f722d7468652d6261646765) ](https://filamentphp.com/docs/5.x/introduction/installation) [ ![Packagist](https://camo.githubusercontent.com/f80214e42ac3f4bac59c58399c2c6fab6534c84d09aa339b1a6c858d1b3b3a0c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6167656e636574776f6765746865722f66696c616d656e742d616c6572742d626f782e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374) ](https://packagist.org/packages/agencetwogether/filament-alert-box) [ ![Code Style Passing](https://camo.githubusercontent.com/5bb278df75209d40f89d88ba571c0db8b3138228bbd74eafef9f878483bf76e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6167656e636574776f6765746865722f66696c616d656e742d616c6572742d626f782f6c61726176656c2d70696e742e796d6c3f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d636f64652532307374796c65) ](https://packagist.org/packages/agencetwogether/filament-alert-box/actions?query=workflow%3A) [ ![Downloads](https://camo.githubusercontent.com/2ce0db3c0c9005e77600d97148c2ecbcc03fd3bf792c961562249f4f17ae2539/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6167656e636574776f6765746865722f66696c616d656e742d616c6572742d626f782e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/agencetwogether/filament-alert-box)

Filament Alert Box
==================

[](#filament-alert-box)

A [FilamentPHP](https://filamentphp.com) plugin to define and display contextual alerts anywhere on your admin panel pages — Resources, custom Pages — using Filament's native render hooks system.

Alerts are managed through a dedicated settings page in your panel and stored in the database via [`spatie/laravel-settings`](https://github.com/spatie/laravel-settings). No code changes needed after initial setup.

---

Features
--------

[](#features)

- **3 alert scopes** — Resource, Page, Global
- **6 built-in styles** — `info`, `tip`, `success`, `warning`, `danger`, `none`
- **Native Filament render hooks** — place alerts at any registered hook point
- **Settings UI** — fully manage alerts directly from your Filament panel
- **Live preview** — see the alert render in real-time while editing
- **Rich text content** — editor with bold, italic, links, and more
- **Multilingual** — English and French included, fully translatable
- **Highly customizable** — colors, icons, navigation, authorization
- **Custom hooks** — extend with your own render hook names
- **Shield Support** — Built-in permission setup for Filament Shield

---

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

[](#requirements)

- PHP `^8.2`
- FilamentPHP `^4.0 | ^5.0`

AlertBox uses [`spatie/laravel-settings`](https://github.com/spatie/laravel-settings) to store plugin settings. It's pulled in automatically as a Composer dependency — filament-alert-box:install publishes and runs its migration if you don't already have a settings table.

---

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

[](#installation)

**Install the package via Composer:**

```
composer require agencetwogether/filament-alert-box
```

Important

If you have not set up a custom theme and are using Filament Panels follow the instructions in the [Filament Docs (V4)](https://filamentphp.com/docs/4.x/styling/overview#creating-a-custom-theme), [Filament Docs (V5)](https://filamentphp.com/docs/5.x/styling/overview#creating-a-custom-theme)first.

### Automatic installation

[](#automatic-installation)

**Run install command:**

```
php artisan filament-alert-box:install
```

The installer will interactively guide you through:

- Publishing and running the database migrations (creates the `settings` table if needed)
- Seeding demo alerts
- Publishing the configuration file
- Publishing translations for customization
- Publishing views for customization
- Register the plugin in your Filament panel
- Register AlertBox styles in your custom Filament theme
- Configure [Filament Shield](#filament-shield-integration) permission

Then rebuild your assets:

```
npm run build
```

### Manual installation

[](#manual-installation)

Publish and run the migrations with:

```
php artisan vendor:publish --tag="filament-alert-box-migrations"
php artisan migrate
```

You can seed demo alerts using

```
php artisan db:seed --class=Agencetwogether\\AlertBox\\Database\\Seeders\\AlertBoxSeeder
```

You can publish the config file with:

```
php artisan vendor:publish --tag="filament-alert-box-config"
```

You can publish the translations using

```
php artisan vendor:publish --tag="filament-alert-box-translations"
```

You can publish the views using

```
php artisan vendor:publish --tag="filament-alert-box-views"
```

**Register the plugin in your Filament panel provider:**

```
use Agencetwogether\AlertBox\AlertBoxPlugin;

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

**Add the views to your theme.css**

After setting up a custom theme add the following to your theme CSS file.

```
@source '../../../../vendor/agencetwogether/filament-alert-box/resources/views/**/*';
```

Then rebuild your assets:

```
npm run build
```

---

Usage
-----

[](#usage)

Once installed, a **"Manage alerts"** page is added to your panel's navigation. From this page you can create and manage all your alerts without touching any code.

Each alert is defined as a **block** with one of three scopes:

### 🗂 Resource

[](#-resource)

Displays an alert on one or more pages of a specific Resource.

- Select the **Resource** to target
- Optionally enable **scope constraint** to restrict to specific resource pages (Index, Create, Edit, View, etc.)
- Choose the **hook** where the alert should appear

### 📄 Page

[](#-page)

Displays an alert on a specific custom Page registered in your panel.

- Select the **Page** to target
- Choose the **hook** where the alert should appear

### 🌐 Global

[](#-global)

Displays an alert globally on all pages matching the selected hook.

- Choose the **hook** where the alert should appear
- Supports **custom hooks** defined in your configuration

---

Alert Configuration
-------------------

[](#alert-configuration)

Each alert block, regardless of scope, shares a common set of fields:

FieldDescription**Hook**The Filament render hook where the alert is injected**Style**Visual style: `info`, `tip`, `success`, `warning`, `danger`, `none`**Show icon**Whether to display the icon next to the title**Title**The alert's title**Content**Rich text content (bold, italic, underline, links, etc.)**Preview**Live visual preview of the alert---

Available Render Hooks
----------------------

[](#available-render-hooks)

The plugin exposes a curated list of Filament render hooks for each scope.

### Resource hooks

[](#resource-hooks)

HookPosition`panels::page.start`Top of the page`panels::page.end`Bottom of the page`panels::page.header-widgets.before`Before header widgets`panels::page.header-widgets.after`After header widgets`panels::page.footer-widgets.before`Before footer widgets`panels::page.footer-widgets.after`After footer widgets`panels::resource.pages.list-records.table.before`Before the list table`panels::resource.pages.list-records.table.after`After the list table`panels::resource.pages.manage-related-records.table.before`Before related records table`panels::resource.pages.manage-related-records.table.after`After related records table`panels::resource.relation-manager.before`Before a relation manager`panels::resource.relation-manager.after`After a relation manager### Page hooks

[](#page-hooks)

HookPosition`panels::page.start` / `panels::page.end`Top / bottom of page`panels::content.start` / `panels::content.end`Start / end of content area`panels::content.before` / `panels::content.after`Before / after content`panels::page.header-widgets.before` / `.after`Around header widgets`panels::page.header.heading.before` / `.after`Around the page heading`panels::topbar.before` / `panels::topbar.after`Around the top bar`panels::footer`Footer area`panels::simple-layout.start` / `.end`Simple layout bounds`panels::simple-page.start` / `.end`Simple page bounds### Global hooks

[](#global-hooks)

All Page hooks above, plus:

HookPosition`panels::auth.login.form.before` / `.after`Around the login form`panels::auth.register.form.before` / `.after`Around the register form`panels::auth.password-reset.request.form.before` / `.after`Around password reset request form`panels::auth.password-reset.reset.form.before` / `.after`Around the reset form`panels::sidebar.start` / `panels::sidebar.footer`Sidebar areas`panels::sidebar.nav.start` / `panels::sidebar.nav.end`Around sidebar navigation`panels::tenant-menu.before` / `.after`Around the tenant menu`panels::user-menu.profile.before` / `.after`Around the user profile menu---

Plugin Customization
--------------------

[](#plugin-customization)

All options are chainable on `AlertBoxPlugin::make()`.

### Navigation

[](#navigation)

```
AlertBoxPlugin::make()
    ->navigationLabel('Alerts')
    ->navigationIcon('heroicon-o-bell-alert')
    ->navigationGroup('Settings')
    ->navigationSort(5)
    ->title('Alert Management'),
```

### Page Access Control

[](#page-access-control)

The `ManageAlertBox` settings page follows a **three-level priority chain** to decide whether the current user is allowed to access it. Each level is evaluated in order; the first one that applies wins.

#### Priority 1 — Filament Shield permission *(highest)*

[](#priority-1--filament-shield-permission-highest)

If Shield is installed in your project **and** you have generated the permissions for this page, access is controlled exclusively by the generated permission e.g. `View:ManageAlertBox`.

The page will be visible only to users (or roles) that have been granted that permission in your Shield configuration. The `->authorize()` option described below is ignored in this case.

Note

If Shield is installed, but you have **not yet run** `shield:generate`, this level is skipped and the chain falls through to the next one. The page will not silently disappear while you are setting things up.

---

#### Priority 2 — Custom `->authorize()` closure

[](#priority-2--custom--authorize-closure)

If Shield is not installed (or its permission has not been generated yet), you can restrict access with your own logic by passing a closure to the `->authorize()` method when registering the plugin in your panel provider:

```
AlertBoxPlugin::make()
    ->authorize(fn (): bool => auth()->user()->isAdmin()),
```

The closure receives no arguments and must return a `bool`. It is evaluated on every request, so you can use any runtime check — roles, model attributes, feature flags, etc.:

```
AlertBoxPlugin::make()
    ->authorize(fn (): bool => auth()->user()->hasRole('editor')),
```

Note

This level is only reached when Shield is **not** managing access for this page. If Shield is active and the permission exists, this closure is never called.

---

#### Priority 3 — Open access *(default)*

[](#priority-3--open-access-default)

If neither of the above applies — Shield is not installed and `->authorize()` was never called — the page is accessible to **every authenticated user who has access to the panel**. This is the default behavior and requires no configuration.

---

#### Summary

[](#summary)

SituationWho can access the pageShield installed + permission generatedUsers/roles granted `View:ManageAlertBox`Shield installed, permission **not** generatedFalls through to the next rule`->authorize(fn ...)` defined, no ShieldUsers for whom the closure returns `true`Neither Shield nor `->authorize()`All authenticated panel users---

### Colors

[](#colors)

Override the default Tailwind colors for each alert style:

```
AlertBoxPlugin::make()
    ->colorInfo('blue')
    ->colorTip('violet')
    ->colorSuccess('emerald')
    ->colorWarning('amber')
    ->colorDanger('rose'),
```

### Builder UI

[](#builder-ui)

```
AlertBoxPlugin::make()
    ->blocksCollapsible()       // Allow collapsing alert blocks
    ->blocksCollapsed()         // Collapse all blocks by default (implies collapsible)
    ->iconResource('heroicon-o-table-cells')
    ->iconPage('heroicon-o-document')
    ->iconGlobal('heroicon-o-globe-alt')
    ->addActionAlignment(\Filament\Support\Enums\Alignment::Center),
```

---

Configuration
-------------

[](#configuration)

After publishing the config file, you can customize:

```
// config/filament-alert-box.php

return [
    'page' => [
        'slug'    => 'alert-box',   // URL slug for the settings page
        'cluster' => null,          // Optional cluster class
    ],

    'toolbar_buttons' => [
        ['bold', 'italic', 'underline', 'strike', 'subscript', 'superscript', 'link'],
        ['undo', 'redo'],
    ],

    'default_icons' => [
        'info'    => Heroicon::OutlinedInformationCircle,
        'tip'     => Heroicon::OutlinedLightBulb,
        'success' => Heroicon::OutlinedCheckCircle,
        'warning' => Heroicon::OutlinedExclamationTriangle,
        'danger'  => Heroicon::OutlinedFire,
        'none'    => null,
    ],

    'default_colors' => [
        'info'    => 'sky',
        'tip'     => 'purple',
        'success' => 'green',
        'warning' => 'yellow',
        'danger'  => 'red',
        'none'    => null,
    ],

    // Add your own Filament render hooks here
    // See: https://filamentphp.com/docs/5.x/advanced/render-hooks
    'custom_hooks' => [
        // 'panels::my-custom-hook',
    ],
];
```

---

Translations
------------

[](#translations)

The plugin ships with English and French translations. To customize them:

```
php artisan vendor:publish --tag=filament-alert-box-translations
```

Files will be published to `lang/vendor/filament-alert-box/`.

---

Views
-----

[](#views)

To customize the alert blade template:

```
php artisan vendor:publish --tag=filament-alert-box-views
```

Files will be published to `resources/views/vendor/filament-alert-box/`.

---

Filament Shield Integration
---------------------------

[](#filament-shield-integration)

The plugin ships with built-in support for [Filament Shield](https://github.com/bezhanSalleh/filament-shield). Shield is entirely optional — without it, **"Manage alerts"** page is accessible to any authenticated user unless you set explicitly [`authorize()`](#page-access-control) method when you register the plugin.

### Automatic setup

[](#automatic-setup)

If Shield is installed, the `filament-alert-box:install` command will generate permission entries via `shield:generate`

### Manual setup

[](#manual-setup)

If you prefer to set up Shield manually, or if the automatic setup didn't complete:

```
php artisan shield:generate --panel=admin --option=permissions
```

### Supported permissions

[](#supported-permissions)

**Manage alerts** page has its own page-level permission managed by Shield.

---

Suggested Companion Plugin
--------------------------

[](#suggested-companion-plugin)

[**agencetwogether/hookshelper**](https://github.com/agencetwogether/hookshelper) — A simple Filament plugin to toggle a visual overlay of all available render hooks on the current page. Very useful when configuring alert positions.

---

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

---

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

---

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](.github/SECURITY.md) on how to report security vulnerabilities.

---

Credits
-------

[](#credits)

- [Max](https://github.com/agencetwogether)
- [All Contributors](../../contributors)

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity23

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Every ~3 days

Total

2

Last Release

27d ago

PHP version history (2 changes)1.0.0PHP ^8.2

1.1.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/04923f4e9213a358f93d2e5307ce4e756c674f6cc110eadc9945b6501663e0d3?d=identicon)[agencetwogether](/maintainers/agencetwogether)

---

Top Contributors

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

---

Tags

alertfilamentfilament-pluginhookslaravellaravelhooksfilamentphpagencetwogetherfilament-alert-box

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/agencetwogether-filament-alert-box/health.svg)

```
[![Health](https://phpackages.com/badges/agencetwogether-filament-alert-box/health.svg)](https://phpackages.com/packages/agencetwogether-filament-alert-box)
```

###  Alternatives

[mradder/filament-logger

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

2210.5k](/packages/mradder-filament-logger)[awcodes/filament-quick-create

Plugin for Filament Admin that adds a dropdown menu to the header to quickly create new items.

249203.6k11](/packages/awcodes-filament-quick-create)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[guava/filament-knowledge-base

A filament plugin that adds a knowledge base and help to your filament panel(s).

207140.2k1](/packages/guava-filament-knowledge-base)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6643.3k](/packages/marcelweidum-filament-passkeys)[a2insights/filament-saas

Filament Saas for A2Insights

171.5k](/packages/a2insights-filament-saas)

PHPackages © 2026

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