jeffersongoncalves/filament-metrics-plausible
A Filament plugin that brings Plausible Analytics into your admin panel, with dashboard widgets for visitors, pageviews, traffic sources, and other key metrics. Configure your Plausible API key and site ID, then drop the widgets into any Filament panel for at-a-glance, privacy-friendly analytics.
This release adds Plugin::make()->navigationGroup(...) to the Filament plugin, letting the analytics settings page sit in one of your panel's own navigation groups instead of the package's translated default (requires filament-analytics-core 3.1).
filament-analytics-core ^3.1) and run migrations if prompted.app/Providers/Filament/*PanelProvider.php:use Vendor\Analytics\Plugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
Plugin::make()
->navigationGroup('Insights')
);
}
php artisan filament:optimize-clear or optimize:clear) and reload the panel — the settings page should now appear under Insights.First use case: drop the analytics settings page next to your other admin/settings resources so operators find analytics configuration where they already look, rather than in a separate translated group.
Static group name — the common case, matching an existing NavigationGroup or plain string used elsewhere in the panel:
Plugin::make()->navigationGroup('Reports')
Closure for context-dependent grouping — evaluate per-request or per-user; useful when group naming depends on tenant, locale, or permissions:
Plugin::make()->navigationGroup(fn () => auth()->user()?->isAdmin()
? 'System'
: 'Analytics')
Conditional registration — only set the group when your panel actually defines it, otherwise leave the package default intact:
$plugin = Plugin::make();
if ($panel->getNavigationGroups()->isNotEmpty()) {
$plugin->navigationGroup('Insights');
}
Panel provider extraction — for multi-panel apps, keep plugin configuration in a small helper or config-driven factory so each panel's group naming stays consistent:
Plugin::make()->navigationGroup(config('analytics.navigation_group'))
Integration tips
->navigationLabel() / icon methods (if exposed by the plugin) to fully control the settings entry.navigationGroup() requires filament-analytics-core 3.1+. On older core the method may be absent or silently ignored — check composer show before debugging navigation.php artisan filament:optimize-clear if you use filament:optimize; cached component/navigation data will otherwise show the old group.null (or not calling the method) preserves the package's translated group. If you want translated behavior back, remove the call rather than passing an empty string — '' is a group name, not "unset".__('navigation.groups.insights') from a closure.dd() inside your closure) and compare against $panel->getNavigationGroups(); ordering is decided by the panel's group registration first, then plugin insertion order.How can I help you explore Laravel packages today?