2017 © Pedro Peláez
 

library laravel-mixpanel

Bundle mixpanel for laravel

image

timothylhuillier/laravel-mixpanel

Bundle mixpanel for laravel

  • Saturday, September 12, 2015
  • by timothylhuillier
  • Repository
  • 2 Watchers
  • 8 Stars
  • 5,170 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 8 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

laravel-mixpanel

In config.php add Timothylhuillier\LaravelMixpanel\LaravelMixpanelServiceProvider in the provider list and 'LaravelMixpanel' => 'Timothylhuillier\LaravelMixpanel\Facades\LaravelMixpanel' in aliases., (*1)

Then in terminal : php artisan config:publish timothylhuillier/laravel-mixpanel and add your token in app/config/package/timothylhuillier/laravel-mixpanel/config.php, (*2)

In the config package the regex 'userAgent' => '^Mozilla((?!bot).)*$' skips all bot., (*3)


Now, to use this package, there is 2 solutions : - You can use 'LaravelMixpanel::', ie. LaravelMixpanel::track('Homepage View', ['connected' => false]), (*4)

But with this solution, mixpanel people is unavailable. Then, I created getInstance()., (*5)

  • The second solution is to use $mixpanel = LaravelMixpanel::getInstance();

For example :, (*6)

<?php
$mixpanel = LaravelMixpanel::getInstance();
// identifie l'user
$mixpanel->identify($user->mixpanel_id);
// track l'event
$mixpanel->track("Upgraded account");

// MAJ de l'user dans la BDD de mixpanel
$mixpanel->people->set($user->mixpanel_id, array(
    '$name'       => $user->name,
    '$phone'      => $user->tel,
    '$address'    => $user->address,
    '$lat'        => $user->lat,
    '$lng'        => $user->lng,
));

The Versions

12/09 2015

dev-master

9999999-dev

Bundle mixpanel for laravel

  Sources   Download

BSD-2-Clause

The Requires

 

11/03 2014

dev-develop

dev-develop

Bundle mixpanel for laravel

  Sources   Download

BSD-2-Clause

The Requires