Skip to content

tbleckert/openpanel-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openpanel for Laravel

Latest Version on Packagist

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.

About

Laravel provider for Openpanel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages