PHP code example of cachethq / segment

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

    

cachethq / segment example snippets


'providers' => [
    // ...
    'CachetHQ\Segment\SegmentServiceProvider',
],

'aliases' => [
    // ...
    'Segment'  => 'CachetHQ\Segment\Facades\Segment',
],

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

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