PHP code example of suth / laravel-sift

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

    

suth / laravel-sift example snippets


Suth\LaravelSift\SiftServiceProvider::class,

'SiftScience' => Suth\LaravelSift\Facades\SiftScience::class,

@

// Import the facade
use SiftScience;

// Returns the SiftClient class
SiftScience::client();

// Track an event
SiftScience::client()->track('$transaction', [
    '$user_id'          => SiftScience::getUserId(),
    '$amount'           => 1000000,
    '$currency_code'    => 'USD',
    '$user_email'       => $user->email,
    '$transaction_type' => '$sale',
    '$transaction_status' => '$success',
    '$session_id'       => SiftScience::getSessionId(),
]);

php artisan vendor:publish --provider="Suth\LaravelSift\SiftServiceProvider"