Sending usage

PHP / Laravel SDK

A Composer package with a service provider, so it feels native.

3 min read

Install

composer require pixeldata/laravel
app/Http/Controllers/CallController.php
use PixelData\Facades\Pixel;

Pixel::track([
    'event_id'   => (string) Str::uuid(),
    'event_type' => 'call',
    'timestamp'  => now()->toIso8601String(),
    'account'    => $customer->reference,
    'quantity'   => $call->duration_seconds,
    'unit'       => 'seconds',
    'properties' => ['destination' => $call->destination],
]);

The service provider registers a queued dispatcher, so tracking never sits in the request path.