PHP code example of canerdogan / laravel-mixpanel

1. Go to this page and download the library: Download canerdogan/laravel-mixpanel library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

canerdogan / laravel-mixpanel example snippets


CanErdogan\LaravelMixpanel\Providers\LaravelMixpanelService::class,

// Laravel 5.3
'providers' => [
    'users' => [
        'driver' => '...',
        'model' => App\User::class,
    ],

// Laravel 5.1
'model' => App\User::class,

event( new MixpanelEvent( 'Dashboard' ) );

event( new MixpanelEvent( 'Welcome Modal', Auth::user() ) );

event( new MixpanelEvent( 'Send Invitation', ['Status' => 'Done'] ) );

event( new MixpanelEvent( 'increment', ['Login Count', 1] ) );

    protected $except = [
        'canerdogan/laravel-mixpanel/stripe',
    ];

use CanErdogan\LaravelMixPanel\LaravelMixPanel;

class MyClass
{
    protected $mixPanel;

    public function __construct(LaravelMixPanel $mixPanel)
    {
        $this->mixPanel = $mixPanel;
    }
}

$mixPanel = app('mixpanel');
sh
php artisan mixpanel:publish --assets