bleckert / openpanel-laravel
Laravel provider for Openpanel
Installs: 5 030
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/bleckert/openpanel-laravel
Requires
- php: ^8.2
- illuminate/contracts: ^10.0|^11.0|^12.0
- illuminate/http: ^10.0|^11.0|^12.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); // Set profile ID that will be used for all events as the `profileId` property. $openpanel->setProfileId(1); // Update user profile $openpanel->identify( profileId: 1, firstName: 'John Doe', lastName: 'Doe', email: 'joe@doe.com', // ... ); // Track event $openpanel->track( name: 'User registered', ); // Increment property $openpanel->increment('visits'); // Decrement property $openpanel->decrement('visits');
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.