bleckert / openpanel-laravel
Laravel provider for Openpanel
Requires
- php: ^8.2
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- laravel/pint: ^1.13
- phpunit/phpunit: ^9.0
README
Simple Laravel provider for Openpanel event tracking.
Installation
You can install the package via composer:
composer require bleckert/openpanel-laravel
Setup
Grab your Openpanel ID and secret by navigating to Settings -> Projects and create a client using typ "Other". You'll then recieve an ID and secret.
Add the following to your .env
file:
OPENPANEL_CLIENT_ID=your-id OPENPANEL_CLIENT_SECRET=your-secret
If you self-host Openpanel, you can set the OPENPANEL_URL
variable to your Openpanel URL.
OPENPANEL_URL=https://your-openpanel-url.com
Usage
use Bleckert\OpenpanelLaravel\Openpanel; $openpanel = app(Openpanel::class); // Identify user $openpanel->setProfileId(1); // Update user profile $openpanel->setProfile( id: 1, firstName: 'John Doe', // ... ); // Track event $openpanel->event( name: 'User registered', );
Run in background
By default, Openpanel requests are sent synchronously. If you want to send the requests in the background, you can set OPENPANEL_QUEUE_CONNECTION
in your env file.
OPENPANEL_QUEUE_CONNECTION=redis
Optionally, you can set the queue name:
OPENPANEL_QUEUE_NAME=your-queue-name
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.