Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elasticorange/laravelmixpanel

Mixpanel package interface for Laravel 5
https://github.com/elasticorange/laravelmixpanel

Last synced: 16 days ago
JSON representation

Mixpanel package interface for Laravel 5

Awesome Lists containing this project

README

        

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`:

```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:

```php
'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:

'YOUR TOKEN HERE'
];

Replace with your Mixpanel token.

After this you can start using it in your application

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