### Install Development Dependencies Source: https://github.com/panphp/pan/blob/main/CONTRIBUTING.md Install the necessary development dependencies for the project using Composer. ```bash composer install ``` -------------------------------- ### Install Pan PHP Package Source: https://github.com/panphp/pan/blob/main/README.md Install the Pan library into your PHP project using Composer. ```bash composer require panphp/pan ``` -------------------------------- ### Install Pan into Laravel Project Source: https://github.com/panphp/pan/blob/main/README.md Install Pan into your Laravel project after requiring it via Composer. ```bash php artisan install:pan ``` -------------------------------- ### Configure Route Prefix Source: https://github.com/panphp/pan/blob/main/README.md Change the default `/pan` route prefix for Pan's analytics endpoint using the `routePrefix` method. The example sets it to `internal-analytics`. ```php PanConfiguration::routePrefix('internal-analytics'); ``` -------------------------------- ### Lint Code with Composer Source: https://github.com/panphp/pan/blob/main/CONTRIBUTING.md Run the linting process to ensure code style compliance using Composer. ```bash composer lint ``` -------------------------------- ### Run All Tests with Composer Source: https://github.com/panphp/pan/blob/main/CONTRIBUTING.md Execute all defined tests for the project using Composer. ```bash composer test ``` -------------------------------- ### Globally Track All Filament Actions Source: https://github.com/panphp/pan/blob/main/README.md Configure all Filament actions to automatically include a `data-pan` attribute based on their label by adding this to a service provider's `boot` method. ```php use Filament\Actions\Action; public function boot(): void { Action::configureUsing(function (Action $action): void { $action->extraAttributes(fn () => ['data-pan' => $action->getLabel()]); }); } ``` -------------------------------- ### Run Unit Tests with Composer Source: https://github.com/panphp/pan/blob/main/CONTRIBUTING.md Execute only the unit tests for the project using Composer. ```bash composer test:unit ``` -------------------------------- ### Visualize Product Analytics Source: https://github.com/panphp/pan/blob/main/README.md Use the `pan` Artisan command to visualize your product analytics. You can filter the results using the `--filter` option. ```bash php artisan pan ``` ```bash php artisan pan --filter=tab-profile ``` -------------------------------- ### Check Types with Composer Source: https://github.com/panphp/pan/blob/main/CONTRIBUTING.md Perform type checking on the project's code using Composer. ```bash composer test:types ``` -------------------------------- ### Track Filament Action with data-pan Source: https://github.com/panphp/pan/blob/main/README.md Add the `data-pan` attribute to a specific Filament action using `extraAttributes` to track its events. ```php Action::make('subscribe') ->extraAttributes(['data-pan' => 'subscribe-button']) ``` -------------------------------- ### Flush Product Analytics Source: https://github.com/panphp/pan/blob/main/README.md Execute the `pan:flush` Artisan command to clear all product analytics data from the database. ```bash php artisan pan:flush ``` -------------------------------- ### Disable Analytics Limit Source: https://github.com/panphp/pan/blob/main/README.md Use `unlimitedAnalytics` to allow an unlimited number of analytics records to be created. Use with caution. ```php PanConfiguration::unlimitedAnalytics(); ``` -------------------------------- ### Set Maximum Analytics Limit Source: https://github.com/panphp/pan/blob/main/README.md Configure a maximum number of analytics records to be created using `maxAnalytics`. This provides an additional layer of protection against unwanted analytics. ```php PanConfiguration::maxAnalytics(10000); ``` -------------------------------- ### Whitelist Specific Analytics Source: https://github.com/panphp/pan/blob/main/README.md Use `allowedAnalytics` to specify which analytics records Pan should track. This prevents unwanted analytics from being stored. ```php use Pan\PanConfiguration; public function register(): void { PanConfiguration::allowedAnalytics([ 'tab-profile', 'tab-settings', ]); } ``` -------------------------------- ### Track Tabs with data-pan Attribute Source: https://github.com/panphp/pan/blob/main/README.md Add the `data-pan` attribute to HTML elements to track events like tab views. Event names must only contain letters, numbers, dashes, and underscores. ```html