jeffersongoncalves/laravel-fathom

This Laravel package seamlessly integrates Fathom analytics into your Blade templates. Easily track website visits and user engagement directly within your Laravel application, providing valuable insights into your website's performance. This package simplifies the integration process, saving you ti

Installs: 497

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

pkg:composer/jeffersongoncalves/laravel-fathom

3.0.0 2026-02-21 02:16 UTC

This package is auto-updated.

Last update: 2026-02-21 02:18:27 UTC


README

Laravel Fathom

Laravel Fathom

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

This Laravel package seamlessly integrates Fathom analytics into your Blade templates. Easily track website visits and user engagement directly within your Laravel application, providing valuable insights into your website's performance. This package simplifies the integration process, saving you time and effort. With minimal configuration, you can leverage Fathom's powerful analytics features to gain a clearer understanding of your audience and website usage.

Settings are stored in the database using spatie/laravel-settings, allowing you to manage them dynamically (e.g., via an admin panel) without relying on .env files.

Installation

You can install the package via composer:

composer require jeffersongoncalves/laravel-fathom

Publish and run the settings migration:

php artisan vendor:publish --tag=fathom-settings-migrations
php artisan migrate

Configuration

All settings are managed exclusively from the database after running the migration. You can update them programmatically:

use JeffersonGoncalves\Fathom\Settings\FathomSettings;

$settings = app(FathomSettings::class);
$settings->website_id = 'NEW_SITE_ID';
$settings->spa = 'history';
$settings->save();

Or use the helper function:

$settings = fathom_settings();
$settings->website_id = 'NEW_SITE_ID';
$settings->save();

Or use the Facade:

use JeffersonGoncalves\Fathom\Facades\Fathom;

$websiteId = Fathom::website_id;

Usage

Add the Fathom script to your Blade layout (typically in <head>):

@include('fathom::script')

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.