anselmokossa/filament-sentinel 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

anselmokossa/filament-sentinel

Composer 安装命令:

composer require anselmokossa/filament-sentinel

包简介

Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.

README 文档

README

Filament Sentinel

Filament Sentinel

Branded, diagnostic error pages for Filament.

Filament v5 PHP 8.2+ Laravel 12 Tests MIT License

A drop-in replacement for Laravel's default 500, 403, 404, 419 and 503 pages, built from native Filament UI so they inherit your panel's colours, fonts, brand logo and dark mode automatically.

  • Native Filament, not a bespoke theme — pages are composed from <x-filament::button>, badge, section and icon, on a light theme-aware scaffold. No design system to maintain.
  • Real data, never invented — content is derived from the actual exception: authorization detail on 403, the missing path on 404, Retry-After on 503, and on 500 the real exception behind a "View more" panel — class, location, message and a structured, debugger-style stack trace, unwrapped to the root cause. Exposure follows APP_DEBUG by default; force it on/off with show_exception_details.
  • SAP-style message numbers (e.g. SNT-500-087), stable per error signature — the same failure always quotes the same number, easy to give to support.
  • Request ids assigned by middleware and echoed on the response, so the id on the page matches your logs.
  • Translations for English, European Portuguese and Brazilian Portuguese.

Screenshots

A panel action failed — the branded 500 appears over the real, still-visible page

500 overlay over a live Filament panel

403 Access denied
403 — access denied, with the real reason
404 Page not found
404 — page not found, with the missing path
419 Session expired
419 — session expired
503 Down for maintenance
503 — maintenance, with Retry-After

Installation

composer require anselmokossa/filament-sentinel

That's it. The package auto-registers and its pages become the default for aborted requests — nothing to publish. Your app can still override any page by adding its own resources/views/errors/{code}.blade.php.

The pages reuse Filament's published base stylesheet (public/css/filament/filament/app.css). It is created by php artisan filament:assets, which Filament already runs on install and deploy.

Register the plugin (optional)

Add the plugin to a panel to configure it fluently. This is optional — the pages work without it.

use Filament\Sentinel\SentinelPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            SentinelPlugin::make()
                ->brand('Acme')                 // defaults to the panel/app name
                ->messagePrefix('ACM')           // ACM-500-087
                ->windowPosition('bottom-right')  // or ->fullPage() for a full-page 500
                ->email('help@acme.test')        // "Contact support" mailto:
                ->homeUrl('/admin'),
        ]);
}

Configuration

Publish the config to tweak defaults:

php artisan vendor:publish --tag=sentinel-config
Option Description Default
enabled Serve the branded pages at all true
codes Status codes Sentinel provides [500, 403, 404, 419, 503]
brand Wordmark shown on each page panel / app name
message_number.enabled Show the SNT-500-087 reference true
message_number.prefix Message-number prefix SNT
request_id.enabled Show and assign a request id true
show_exception_details Reveal the real exception on 500: null follows APP_DEBUG, true always, false never null
window.style 500 presentation: window (small docked) or page (full page, like the other codes) window
window.position Docked window placement: bottom-left, bottom-right, top-left, top-right, top-center, bottom-center, center, or a full-height slide-over with slide-right / slide-left bottom-left
window.width Docked window width — a number (pixels) or CSS length ("28rem") 400
support_url URL / mailto: for "Contact support" null
home_url Destination of the primary button /

Fluent API

Every option above is also settable on SentinelPlugin::make(); anything left unset falls back to config/sentinel.php.

Method Purpose
->brand($name) Wordmark on every page
->messagePrefix($prefix) Prefix of the message number
->messageNumbers($bool) Toggle message numbers
->requestId($bool) Toggle the request id
->showExceptionDetails($bool) Force the 500 exception panel on (true) or off (false); omit to follow APP_DEBUG
->windowPosition($position) Where the docked 500 window sits (center, top-right, slide-right, …)
->windowWidth($width) Docked window width (460 or "28rem")
->fullPage($bool = true) Render the 500 as a full page like the other codes
->supportUrl($url) "Contact support" link
->email($address) "Contact support" as a mailto: link
->homeUrl($url) Primary "back to safety" destination
->codes($array) Status codes to brand
->enabled($bool) Disable the whole package

Publishing & customization

php artisan vendor:publish --tag=sentinel-config        # config/sentinel.php
php artisan vendor:publish --tag=sentinel-translations  # lang files to edit the wording
php artisan vendor:publish --tag=sentinel-views         # the Blade views, to restyle

Overriding a page

Because the pages register as the default errors::{code} views, you override any of them the standard Laravel way — add your own resources/views/errors/404.blade.php and it wins.

Eject — keep the pages after removing the plugin

php artisan vendor:publish --tag=sentinel-errors

This drops a self-contained set of error pages (500, 403, 404, 419, 503) straight into resources/views/errors/. They have no dependency on this package — or even on Filament (their own palette, inlined styles and icons, only Laravel core for the message number, request id and exception detail), so they stay branded and keep working even after you composer remove the plugin. From then on they are yours to edit. The published copies live in your app, so they take precedence over the plugin immediately.

Testing

composer test

License

MIT. See LICENSE.md.

anselmokossa/filament-sentinel 适用场景与选型建议

anselmokossa/filament-sentinel 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 07 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「exception-handler」 「filament」 「error-pages」 「filament-plugin」 「http-errors」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 anselmokossa/filament-sentinel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 anselmokossa/filament-sentinel 我们能提供哪些服务?
定制开发 / 二次开发

基于 anselmokossa/filament-sentinel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 10
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: Blade

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-15