PHP code example of binarcode / laravel-segment

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

    

binarcode / laravel-segment example snippets


return [
    /**
     * The queue name where the segment events will be dispatched.
     */
    'queue' => env('SEGMENT_QUEUE', env('QUEUE_CONNECTION', 'sync')),

    /**
     * Segment API key [see: https://segment.com/docs/connections/sources/catalog/libraries/server/php/#identify].
     */
    'key' => env('SEGMENT_KEY', ''),
];

BinarCode\LaravelSegment\Facades\LaravelSegment::track('click')->properties([...])

BinarCode\LaravelSegment\Facades\LaravelSegment::alias($previous, $userId);

BinarCode\LaravelSegment\Facades\LaravelSegment::identify($userId, $data);
bash
php artisan vendor:publish --tag="segment-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="segment-config"