### Install filament-analytics-core via Composer Source: https://github.com/jeffersongoncalves/filament-analytics-core/blob/3.x/README.md Install the package via Composer. Requires PHP 8.2+, Laravel 11.0+, and Filament 5.x (3.x branch). ```bash composer require jeffersongoncalves/filament-analytics-core:"^3.0" ``` -------------------------------- ### Create a service provider by extending AbstractAnalyticsServiceProvider Source: https://github.com/jeffersongoncalves/filament-analytics-core/blob/3.x/README.md Extend AbstractAnalyticsServiceProvider to wire translations and inject tracking scripts via render hooks. Must implement packageName() and renderHooks(). ```php use Filament\View\PanelsRenderHook; use JeffersonGoncalves\FilamentAnalyticsCore\AbstractAnalyticsServiceProvider; class FathomServiceProvider extends AbstractAnalyticsServiceProvider { protected function packageName(): string { return 'filament-fathom'; } protected function renderHooks(): array { return [ PanelsRenderHook::HEAD_START => 'fathom::script', ]; } } ``` -------------------------------- ### Create a plugin by extending AbstractAnalyticsPlugin Source: https://github.com/jeffersongoncalves/filament-analytics-core/blob/3.x/README.md Extend AbstractAnalyticsPlugin to create a plugin. Must implement getId() and getSettingsPageClass(). The settingsPage(bool) toggle is inherited from the base class. ```php use JeffersonGoncalves\FilamentAnalyticsCore\AbstractAnalyticsPlugin; class FathomPlugin extends AbstractAnalyticsPlugin { public function getId(): string { return 'filament-fathom'; } protected function getSettingsPageClass(): ?string { return FathomSettingsPage::class; } } ``` -------------------------------- ### Run tests with composer test Source: https://github.com/jeffersongoncalves/filament-analytics-core/blob/3.x/README.md Run the package test suite. ```bash composer test ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.