<?php
namespace App\Services;
use Mixpanel;
class MixpanelService
{
protected $mixpanel;
public function __construct()
{
$this->mixpanel = new Mixpanel(env('MIXPANEL_TOKEN'));
}
public function track($event, $properties = [])
{
$this->mixpanel->track($event, $properties);
}
public function identify($distinctId)
{
$this->mixpanel->identify($distinctId);
}
public function peopleSet($distinctId, $properties)
{
$this->mixpanel->people->set($distinctId, $properties);
}
}