PHP code example of serato / app-events

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

    

serato / app-events example snippets


use Serato\AppEvents\Event\SeraTo\Redirect;

$event = new Redirect;
$event
    ->setHttpReferrer('http://serato.com/dj')
    ->setClientIp('24.30.52.126')
    ->setUserAgent(
        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' .
        '(KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36'
    )
    ->setRedirectId('id-123')
    ->setRedirectName('Manage Subscription')
    ->setRedirectGroup('Serato DJ (app)')
    ->setRedirectShortUrl('sera.to/-b6ap')
    ->setRedirectDestinationUrl('https://account.serato.com/#/subscriptions');

use Serato\AppEvents\EventTarget\Filebeat;
use Serato\AppEvents\Event\SeraTo\Redirect;

$event = new Redirect;
# Populate $event...

# Create the event target instance.
# Application name is important. ALL events will be tagged with the application name.
$eventTarget = new Filebeat('My App Name', '/path/to/log/file.log');
# Send the event to the target
$eventTarget->sendEvent($event);