ziming / filament-oh-dear
A read-only Filament 4/5 panel plugin for Oh Dear monitor insights.
Fund package maintenance!
Requires
- php: ^8.4
- filament/filament: ^4|^5
- illuminate/contracts: ^13.0
- ohdearapp/ohdear-php-sdk: ^4
- spatie/laravel-package-tools: ^1.93
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.29
- nunomaduro/collision: ^8.9
- orchestra/testbench: ^11.0
- orchestra/workbench: ^11.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
README
Read-only Oh Dear insights for Filament 4 and 5 panels. The plugin renders remote Oh Dear monitor data directly from the API, caches responses through Laravel, and avoids local sync tables or CRUD flows.
This package is still very much in progress, when it is ready I will tag a 1.0
Support Us
You can donate to my github sponsor or use my referral link for Oh Dear so I get a small reward if you become a paid customer in the future. This comes at no extra cost to you and helps support my open source work.
https://ohdear.app/?via=filament-oh-dear
Features
Overviewpage composed of pluggable widgets — stats, needs-attention list, monitors-by-group breakdownMonitorspage powered by Filament custom table data- Hidden
Monitor detailspage composed of pluggable per-monitor widgets: summary, check summaries, latency chart, certificate health, broken links, downtime, mixed content, latest Lighthouse report, application health checks, maintenance periods, domain info - Add, remove, or replace any widget on either page via the plugin fluent API or package config
- Package config defaults with per-panel plugin overrides
php artisan filament-oh-dear:verifyfor connection checks
Installation
composer require ziming/filament-oh-dear
Publish the config if you want to customize defaults:
php artisan vendor:publish --tag="filament-oh-dear-config"
Environment
OH_DEAR_API_TOKEN= OH_DEAR_TEAM_ID= OH_DEAR_MONITOR_IDS=1,2,3 OH_DEAR_CACHE_STORE= OH_DEAR_CACHE_TTL=300
OH_DEAR_API_TOKENis required.OH_DEAR_TEAM_IDis optional. When omitted, the token default scope is used.OH_DEAR_MONITOR_IDSis optional. When set, only those monitors are shown and their order is preserved.OH_DEAR_CACHE_TTL=0disables caching.
Register The Plugin
use Ziming\FilamentOhDear\FilamentOhDearPlugin; public function panel(Panel $panel): Panel { return $panel ->id('admin') ->path('admin') ->plugin(FilamentOhDearPlugin::make()); }
Per-Panel Overrides
use Ziming\FilamentOhDear\FilamentOhDearPlugin; FilamentOhDearPlugin::make() ->apiToken(fn (): string => decrypt(config('services.oh_dear.token'))) ->teamId(10) ->monitorIds([12, 55, 89]) ->cacheStore('redis') ->cacheTtl(120) ->navigationGroup('Observability') ->navigationIcon('heroicon-o-signal') ->navigationSort(40);
Precedence is always plugin override > package config.
Configuring widgets
Both the Overview and Monitor details pages render a list of Filament widgets
that you can freely mix and match. Defaults come from
Ziming\FilamentOhDear\Support\OhDearSettings::defaultOverviewWidgets() and
defaultMonitorWidgets().
use Ziming\FilamentOhDear\FilamentOhDearPlugin; use Ziming\FilamentOhDear\Widgets\Monitor\ApplicationHealthChecksWidget; use Ziming\FilamentOhDear\Widgets\Monitor\BrokenLinksWidget; use Ziming\FilamentOhDear\Widgets\Monitor\DomainInfoWidget; use Ziming\FilamentOhDear\Widgets\Monitor\LighthouseReportWidget; use Ziming\FilamentOhDear\Widgets\Monitor\MaintenancePeriodsWidget; use Ziming\FilamentOhDear\Widgets\Monitor\MixedContentWidget; use Ziming\FilamentOhDear\Widgets\Overview\MonitorsByGroupWidget; use Ziming\FilamentOhDear\Widgets\Overview\MonitorsByTypeWidget; FilamentOhDearPlugin::make() // Append additional widgets to the defaults ->addOverviewWidgets([ MonitorsByTypeWidget::class, MonitorsByGroupWidget::class, ]) ->addMonitorWidgets([ MixedContentWidget::class, LighthouseReportWidget::class, ApplicationHealthChecksWidget::class, MaintenancePeriodsWidget::class, DomainInfoWidget::class, ]) // Or drop one you don't want ->removeMonitorWidgets(BrokenLinksWidget::class) // Or replace the entire list outright // ->overviewWidgets([OverviewStatsWidget::class]) // ->monitorWidgets([MonitorSummaryWidget::class]) ;
You can also point the package at your own widget classes — anything that
extends BaseMonitorWidget (with a public int $monitorId property) or any
Filament widget accepting an overview array prop will work.
Available widgets
Overview (Ziming\FilamentOhDear\Widgets\Overview\… and
Ziming\FilamentOhDear\Widgets\OverviewStatsWidget):
OverviewStatsWidget– totals and active issue countsNeedsAttentionWidget– list of monitors needing attentionMonitorsByGroupWidget– healthy / issue breakdown per groupMonitorsByTypeWidget– stat tiles per monitor type
Monitor (Ziming\FilamentOhDear\Widgets\Monitor\…):
MonitorSummaryWidget– basic monitor info and statusCheckSummariesWidget– per-check summariesLatencyChartWidget– 24-hour latency sparklineCertificateHealthWidget– TLS certificate details and checksBrokenLinksWidget– broken link findingsDowntimeWidget– recent downtime periodsMixedContentWidget– mixed-content findings (HTTPS pages loading HTTP assets)LighthouseReportWidget– latest Lighthouse scores and web vitalsApplicationHealthChecksWidget– application-reported health checksMaintenancePeriodsWidget– configured maintenance windowsDomainInfoWidget– WHOIS / RDAP snapshot for the domain
Verify Command
php artisan filament-oh-dear:verify
The command checks:
- an API token is configured
me()succeeds- the configured team scope is accessible when
team_idis set - each configured monitor is accessible when
monitor_idsis set
Support Matrix
- PHP:
^8.4 - Filament:
^4 | ^5 - Laravel / illuminate contracts:
^12 | ^13 - Oh Dear SDK:
^4
Screenshots
- Overview page: placeholder
- Monitors table: placeholder
- Monitor detail page: placeholder
Local Development
The repository ships with a Testbench workbench panel:
composer install composer build php vendor/bin/testbench serve
Then open /admin/oh-dear.
Testing
composer test
composer analyse
composer format
Changelog
Please see CHANGELOG for recent changes.
License
The MIT License (MIT). Please see LICENSE.md for more information.