1. Go to this page and download the library: Download larasignal/agent 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/ */
larasignal / agent example snippets
use LaraSignal\Agent\Facades\LaraSignal;
// Measure execution time of a code block
$result = LaraSignal::measure('stripe-payment', function () {
return Stripe::charges()->create([...]);
});
// Record custom domain events
LaraSignal::event('OrderCompleted', ['order_id' => 109, 'amount' => 2500]);
// Attach contextual metadata to all subsequent events in the request/job
LaraSignal::context(['tenant_id' => $tenant->id, 'plan' => 'pro']);
LaraSignal::tag('checkout', 'high-value');
// Scope temporary context
LaraSignal::withContext(['batch' => 4], function () {
// Events inside here inherit batch = 4
});