Download the PHP package mattitjaab/laravel-plausible-proxy without Composer
On this page you can find all versions of the php package mattitjaab/laravel-plausible-proxy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mattitjaab/laravel-plausible-proxy
More information about mattitjaab/laravel-plausible-proxy
Files in mattitjaab/laravel-plausible-proxy
Package laravel-plausible-proxy
Short Description A Laravel package for proxying Plausible Analytics, improving performance and privacy.
License MIT
Homepage https://github.com/mattitjaab/laravel-plausible-proxy
Informations about the package laravel-plausible-proxy
laravel-plausible-proxy
A Laravel package for proxying Plausible Analytics, improving performance and privacy.
Requirements
- Laravel 11
- PHP 8.3+
🚀 Installation
-
Install the package via Composer:
-
Publish the configuration file:
-
Add the following environment variables to your
.env
file: -
(Optional) If you want to use Laravel Queues to send events in the background, ensure your queue driver is set up correctly:
Then run migrations to create the necessary queue tables:
⚙️ Configuration
The config/plausible-proxy.php
file allows you to customize the package settings:
🔥 Usage
1. Proxying the JavaScript file
This package proxies Plausible's script.js
while caching it to improve performance and reduce external requests.
After installation, you can include the script like this:
The route /js/script.js
is automatically handled and caches the script for 6 hours.
2. Sending Events to Plausible
Instead of sending events directly to plausible.io
, you can now send them to /api/event
, and they will be queued and processed asynchronously.
Example request:
✅ Features
- 🚀 Fast & Optimized: Caches the Plausible script to reduce external calls.
- 🔒 Privacy-Friendly: Prevents direct calls to
plausible.io
. - 📊 Improved Performance: Events are processed via Laravel Queues to avoid blocking user interactions.
- 🛠 Fully Configurable: Easily set your own Plausible instance and domain via
.env
.
🛠 Testing
You can run tests with:
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
- Mathias Palmqvist
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-plausible-proxy with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0