jeffersongoncalves/filament-clarity
Integrate Microsoft Clarity analytics with your Filament panels. This package adds the Clarity tracking script and configuration options, helping you capture session recordings, heatmaps, and user behavior insights with minimal setup.
filament-analytics-core 3.1 adds one small but high-leverage knob to the plugin: navigationGroup(). It controls which navigation group the analytics settings page is filed under in your panel.
Minimal setup:
composer require filament-analytics-core:^3.1
Then register the plugin in your panel provider, before or alongside your other plugins:
use Filament\Panel;
use Filament\PanelProvider;
use Vendor\Analytics\AnalyticsPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->default()
->id('admin')
->path('admin')
->plugin(
AnalyticsPlugin::make()
->navigationGroup('Settings'),
);
}
}
Look first at the panel provider where the plugin is already registered — that is the only place navigationGroup() matters. The first use case is almost always "our admin panel has a Settings group and the analytics page is landing in a generic, translated group that doesn't match our information architecture." Add the call, clear the config cache, and the page moves.
If you are not yet on core 3.1, the method does not exist and you will get a BadMethodCallException from the plugin's macro/proxy layer — upgrade core first.
Static group for a fixed IA. The common case. Match the string exactly to the group label your other resources use:
AnalyticsPlugin::make()->navigationGroup('Insights')
This is a cosmetic change only — it does not affect routing, authorization, or the settings page URL, so links and bookmarks keep working.
Closure for localized or tenant-dependent groups. Because the signature accepts string|Closure, you can defer resolution to render time:
AnalyticsPlugin::make()
->navigationGroup(fn () => __('navigation.groups.analytics'))
Useful when a panel is shared across locales, or when the group name is derived from configuration that is not available at provider boot. The closure is resolved when the navigation is built, so per-request values (current team, locale) are safe.
Pair with navigationSort() for deterministic ordering. Grouping and ordering are separate concerns; if the analytics item lands first or last within the new group, set a sort that leaves room for neighbours:
AnalyticsPlugin::make()
->navigationGroup('Settings')
->navigationSort(10)
Multi-panel setups. The method is per-plugin-instance, so each panel can group analytics differently. Register the plugin separately in each panel provider rather than sharing a single configured instance — plugin instances carry mutable state.
Incremental migration. Adopt navigationGroup() panel by panel. Leave low-traffic panels on the default translated group and only override where users actually complain about discoverability. This keeps the diff reviewable and avoids a big-bang navigation reshuffle.
filament-analytics-core. If you constrain core below 3.1 in composer.json while allowing the plugin to float, Composer may resolve a combination where the call fails at runtime rather than install time. Pin both.filament:optimize. Run php artisan filament:optimize-clear (or optimize:clear) after edits, then hard-refresh — stale nav is the most common "the method didn't work" report.__()) in both places.canViewAny-style gates before blaming navigation.How can I help you explore Laravel packages today?