1. Go to this page and download the library: Download scoutapp/scout-apm-laravel 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/ */
$request = new ServiceRequest();
$request->setApiVersion($version);
// At top, with other imports
use Scoutapm\Events\Span\Span;
use Scoutapm\Laravel\Facades\ScoutApm;
// Replacing the above code
$request = ScoutApm::instrument(
'Custom',
'Building Service Request',
static function (Span $span) use ($version) {
$request = new ServiceRequest();
$request->setApiVersion($version);
return $request;
}
);