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
Requires
- php: ^8.2|^8.3
- laravel/framework: ^11.0|^12.0
- spatie/laravel-package-tools: ^1.14.0
- spatie/laravel-settings: ^3.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.27
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.7.4
- pestphp/pest-plugin-laravel: ^3.0
This package is auto-updated.
Last update: 2026-02-21 02:18:27 UTC
README
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 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.
