jeffersongoncalves/filament-goatcounter
A Filament plugin that brings GoatCounter analytics into your admin panel, adding widgets and pages to view site traffic, page views, referrers, and other visitor statistics without leaving your dashboard.
This package adds an analytics dashboard (settings page) to a Filament panel via a plugin object. Minimum steps:
composer require the package alongside filament-analytics-core 3.1+ if you intend to use navigation grouping — the navigationGroup() API depends on core 3.1.->plugin(Plugin::make())
First use case: drop the plugin into the panel, confirm the page renders with your existing auth/permissions, then decide whether to override the navigation group to match your panel's IA (e.g. "Reporting" / "Insights"). Start with the default group and only override once you know where it belongs in your menu.
Default grouping (do nothing). Leaving navigationGroup() unset preserves the translated group shipped with the package — best for single-locale apps or when you want the package's opinion.
Static group name. Align the page with an existing panel group:
Plugin::make()->navigationGroup('Reporting')
Use this when your panel already standardises on string groups across resources/pages.
Closure-based group. Use a closure when the group depends on runtime context (tenant, user role, feature flag):
Plugin::make()->navigationGroup(fn () => filament()->getCurrentPanel()->getId() === 'admin'
? 'Administration'
: 'Insights')
Keep the closure cheap — it is evaluated during navigation building on every panel render.
Consistency pattern. Define group names as constants or an enum shared between the plugin registration and your resources so navigation labels never drift:
enum NavGroup: string { case Reporting = 'Reporting'; }
// ...
Plugin::make()->navigationGroup(NavGroup::Reporting->value)
Multi-panel setups. Register the plugin once per panel with a panel-appropriate group, rather than trying to make one registration serve every panel.
navigationGroup() only exists with filament-analytics-core 3.1+. On older core the method is missing — you'll get a BadMethodCallException at boot, not a silent fallback. Pin the core version in composer.json if you rely on grouping.'' is not the same as omitting the call. If you want the translated default, don't call navigationGroup() at all; don't pass an empty value expecting a reset.auth()->user() lookups inside the closure unless cached.navigationSort rather than the group.__() yourself.php artisan filament:optimize-clear or optimize:clear) and re-check that the plugin is registered on the panel actually being rendered.Plugin::make() over subclassing or touching core package config, so upgrades stay painless.How can I help you explore Laravel packages today?