PHP code example of ersoy-insider / newrelic-custom-event

1. Go to this page and download the library: Download ersoy-insider/newrelic-custom-event 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/ */

    

ersoy-insider / newrelic-custom-event example snippets


$app->register(\ErsoyInsider\NewrelicCustomEvent\NewRelicCustomEventServiceProvider::class);

$app->withFacades(true, [
    '\ErsoyInsider\NewrelicCustomEvent\Facades\NewRelicDispatcher' => 'NewRelicDispatcher'
]);

app('new-relic-dispatcher')->fire($properties);

\NewRelicDispatcher::fire($properties);

$properties = [
    'jobName' => 'test',
    'users' => [
        ['id' => 5, 'name' => 'testasdada'],
        ['id' => 55, 'name' => 'test3'],
        ['id' => 555, 'name' => 'test2'],
        ['id' => 5555, 'name' => 'test4'],
    ],
    'test' => 'another-parameter',
    'yet-another' => 'parameter',
    'will-be' => ['discarded'] // it will be discarded
    'will-not-be' => 'discarded' // it will not be discarded
];