PHP code example of sevenspan / segment-php-sdk

1. Go to this page and download the library: Download sevenspan/segment-php-sdk 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/ */

    

sevenspan / segment-php-sdk example snippets


Segment::identify([
    'userId' => '12345abcde',
    'traits' => [
        'name' => 'James Brooks',
        'email' => '[email protected]',
    ],
]);

Segment::track([
    'userId' => '12345abcde',
    'event' => 'Did something',
    'properties' => [
        'was_awesome' => true,
    ],
]);
bash
$ composer 
bash
$ php artisan vendor:publish