GithubHelp home page GithubHelp logo

openpanel-laravel's Introduction

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.

openpanel-laravel's People

Contributors

tbleckert avatar

Stargazers

Carl-Gerhard Lindesvärd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.