PHPackages                             timothylhuillier/laravel-mixpanel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. timothylhuillier/laravel-mixpanel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

timothylhuillier/laravel-mixpanel
=================================

Bundle mixpanel for laravel

85.2k8PHP

Since Mar 11Pushed 10y ago2 watchersCompare

[ Source](https://github.com/timothylhuillier/laravel-mixpanel)[ Packagist](https://packagist.org/packages/timothylhuillier/laravel-mixpanel)[ RSS](/packages/timothylhuillier-laravel-mixpanel/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

laravel-mixpanel
================

[](#laravel-mixpanel)

In `config.php` add `Timothylhuillier\LaravelMixpanel\LaravelMixpanelServiceProvider` in the provider list and `'LaravelMixpanel' => 'Timothylhuillier\LaravelMixpanel\Facades\LaravelMixpanel'` in aliases.

Then in terminal : `php artisan config:publish timothylhuillier/laravel-mixpanel` and add your token in `app/config/package/timothylhuillier/laravel-mixpanel/config.php`

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

---

Now, to use this package, there is 2 solutions :

- You can use 'LaravelMixpanel::', ie. `LaravelMixpanel::track('Homepage View', ['connected' => false])`

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

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

For example :

```
