### Install laravel-hotjar and publish migrations Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Install the package and publish its settings migrations, then run migrations to create the settings table. ```bash composer require jeffersongoncalves/laravel-hotjar php artisan vendor:publish --tag=hotjar-settings-migrations php artisan migrate ``` -------------------------------- ### Hotjar facade usage Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Shows how to use the Hotjar facade to get the underlying settings instance. ```php use JeffersonGoncalves\Hotjar\Facades\Hotjar; Hotjar::getFacadeRoot(); // returns HotjarSettings instance ``` -------------------------------- ### Install Laravel Hotjar via Composer Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Install the Laravel Hotjar package via Composer. ```bash composer require jeffersongoncalves/laravel-hotjar ``` -------------------------------- ### Package structure overview Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Shows the package directory layout with key files and their roles. ```text laravel-hotjar/ ├── src/ │ ├── HotjarServiceProvider.php # Package service provider │ ├── Facades/Hotjar.php # Facade for HotjarSettings │ ├── Settings/HotjarSettings.php # Settings class (spatie/laravel-settings) │ └── helpers.php # hotjar_settings() helper function ├── database/ │ └── settings/ │ └── 2026_09_07_000000_create_hotjar_settings.php ├── resources/ │ └── views/ │ └── script.blade.php # Hotjar tracking script template └── tests/ ├── TestCase.php # Base test case with SQLite setup ├── Pest.php # Pest configuration ├── HotjarSettingsTest.php # Settings unit tests └── BladeViewTest.php # Blade view rendering tests ``` -------------------------------- ### Publish and Run Hotjar Settings Migration Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Publish and run the settings migration to create the database table for Hotjar settings. ```bash php artisan vendor:publish --tag=hotjar-settings-migrations php artisan migrate ``` -------------------------------- ### Run Tests with Composer Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Run the package test suite. ```bash composer test ``` -------------------------------- ### Run tests and analysis Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Commands to run the test suite, coverage, static analysis, and code style checks. ```bash vendor/bin/pest vendor/bin/pest --coverage vendor/bin/phpstan analyse vendor/bin/pint ``` -------------------------------- ### Access and update Hotjar settings Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Shows how to access and update settings using the helper function or the container. ```php // Helper function (globally available) $settings = hotjar_settings(); // Via Laravel container $settings = app(\JeffersonGoncalves\Hotjar\Settings\HotjarSettings::class); // Update and persist $settings->site_id = '1234567'; $settings->save(); ``` -------------------------------- ### HotjarSettings class definition Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Defines the settings class with group 'hotjar' and properties site_id and version. ```php namespace JeffersonGoncalves\Hotjar\Settings; use Spatie\LaravelSettings\Settings; class HotjarSettings extends Settings { public ?string $site_id; // Hotjar site ID (hjid) public int $version; // Hotjar tracking script version (hjsv, default: 6) public static function group(): string { return 'hotjar'; } } ``` -------------------------------- ### Read and Update Hotjar Settings via Facade Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Read and update Hotjar settings using the Hotjar facade. The facade resolves the underlying HotjarSettings instance, so access properties through getFacadeRoot(). ```php use JeffersonGoncalves\Hotjar\Facades\Hotjar; // Read a value $siteId = Hotjar::getFacadeRoot()->site_id; // Update and persist $settings = Hotjar::getFacadeRoot(); $settings->site_id = '1234567'; $settings->save(); ``` -------------------------------- ### Update Hotjar Settings via Helper Function Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Update Hotjar settings using the hotjar_settings() helper function. ```php $settings = hotjar_settings(); $settings->site_id = '1234567'; $settings->save(); ``` -------------------------------- ### Update Hotjar Settings via Container Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Update Hotjar settings programmatically using the HotjarSettings class resolved from the container. ```php use JeffersonGoncalves\Hotjar\Settings\HotjarSettings; $settings = app(HotjarSettings::class); $settings->site_id = '1234567'; $settings->save(); ``` -------------------------------- ### HotjarServiceProvider registration code Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/resources/boost/skills/hotjar-development/SKILL.md Service provider code that registers views, merges settings, and publishes migrations. ```php // Registers the package with views $package->name('laravel-hotjar')->hasViews(); // Automatically registers HotjarSettings in spatie/laravel-settings config Config::set('settings.settings', array_merge( Config::get('settings.settings', []), [HotjarSettings::class] )); // Publishes settings migrations with tag 'hotjar-settings-migrations' $this->publishes([ $settingsMigrationsPath => database_path('settings'), ], 'hotjar-settings-migrations'); ``` -------------------------------- ### Include Hotjar Script in Blade Layout Source: https://github.com/jeffersongoncalves/laravel-hotjar/blob/master/README.md Include the Hotjar tracking script in your Blade layout, typically in the section. The script only renders when site_id is set. ```php @include('hotjar::script') ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.