Download the PHP package jeffersongoncalves/laravel-cloudflare-web-analytics without Composer
On this page you can find all versions of the php package jeffersongoncalves/laravel-cloudflare-web-analytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jeffersongoncalves/laravel-cloudflare-web-analytics
More information about jeffersongoncalves/laravel-cloudflare-web-analytics
Files in jeffersongoncalves/laravel-cloudflare-web-analytics
Package laravel-cloudflare-web-analytics
Short Description Cloudflare Web Analytics for Laravel: inject the tracking script in your Blade layouts, with the settings stored in the database via spatie/laravel-settings.
License MIT
Homepage https://github.com/jeffersongoncalves/laravel-cloudflare-web-analytics
Informations about the package laravel-cloudflare-web-analytics
Laravel Cloudflare Web Analytics
Add Cloudflare Web Analytics — privacy-first, cookie-free analytics from Cloudflare — to your Laravel app. The settings are stored in the database with spatie/laravel-settings, so you can change them at runtime (e.g. from an admin panel) instead of in .env.
For a Filament settings page, use jeffersongoncalves/filament-cloudflare-web-analytics.
Installation
Publish and run the settings migration:
Configuration
Or through the settings class or the Facade:
Available settings
| Setting | Type | Default | Description |
|---|---|---|---|
token |
?string |
null |
Your Cloudflare Web Analytics token. The script only renders when it is valid. |
Usage
Add the script to your Blade layout, inside <head>:
Nothing is rendered until the settings are complete, so you can ship the include everywhere and turn Cloudflare Web Analytics on later.
Content Security Policy
When your app sets a CSP nonce through Laravel's Vite (Vite::useCspNonce(), as laravel-security-headers does), every <script> this package renders carries it, so a script-src 'self' 'nonce-{nonce}' policy works without 'unsafe-inline'. Scripts loaded afterwards from the vendor's own CDN still need that host in script-src (and its API in connect-src).
Testing
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
- Jefferson Gonçalves
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-cloudflare-web-analytics with dependencies
laravel/framework Version ^12.61.1|^13.12.0
spatie/laravel-package-tools Version ^1.14.0
spatie/laravel-settings Version ^3.0