PHP code example of jeffersongoncalves / filament-analytics-core

1. Go to this page and download the library: Download jeffersongoncalves/filament-analytics-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jeffersongoncalves / filament-analytics-core example snippets


use JeffersonGoncalves\FilamentAnalyticsCore\AbstractAnalyticsPlugin;

class FathomPlugin extends AbstractAnalyticsPlugin
{
    public function getId(): string
    {
        return 'filament-fathom';
    }

    protected function getSettingsPageClass(): ?string
    {
        return FathomSettingsPage::class;
    }
}

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',
        ];
    }
}