ElasticOrange / LaravelMixpanel by hydrarulz

Bundle mixpanel for Laravel 5
358
0
4
Package Data
Maintainer Username: hydrarulz
Maintainer Contact: lucadanielcostin@gmail.com (Daniel Luca)
Package Create Date: 2015-04-24
Package Last Update: 2015-06-15
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-19 15:06:12
Package Statistics
Total Downloads: 358
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 4
Total Forks: 0
Total Open Issues: 0

laravel-mixpanel

Install it with

composer require "hydrarulz/laravel-mixpanel:dev-master"

Add the service provider at the end of the providers array in file config/app.php:

'Hydrarulz\LaravelMixpanel\LaravelMixpanelServiceProvider',

The service provider will register an interface, but you should also register the alias at the end of the aliases array:

'LaravelMixpanel' => 'Hydrarulz\LaravelMixpanel\Facades\LaravelMixpanel',

Then the you should publish the config file with php artisan vendor:publish This creates your config file /config/laravel-mixpanel.php that looks like this:

<?php

return [
    'token' => 'YOUR TOKEN HERE'
];

Replace with your Mixpanel token.

After this you can start using it in your application

$mixpanel = LaravelMixpanel::getInstance();
$mixpanel->people->set(
    $user->mixpanel_id
    , [
        'name' => 'Daniel Luca'
    ]
);
$mixpanel->track(
	'Event'
    , [
        'Type' => 'Click'
    ]
);