hydrarulz / laravel-mixpanel
Bundle mixpanel for Laravel 5
Installs: 358
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
pkg:composer/hydrarulz/laravel-mixpanel
Requires
- php: >=5.4.0
- illuminate/support: 5.0.*
- mixpanel/mixpanel-php: 2.*
This package is not auto-updated.
Last update: 2025-09-27 22:43:50 UTC
README
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' ] );