1. Go to this page and download the library: Download saloonphp/barstool 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/ */
saloonphp / barstool example snippets
// config/barstool.php
'only' => [
'connectors' => [
StripeConnector::class, // record everything sent through this connector...
],
'requests' => [],
],
'ignore' => [
'connectors' => [],
'requests' => [
StripeHealthCheckRequest::class, // ...except this noisy request
],
],
'keep_successful_responses' => false,
'excluded_request_headers' => [
'Authorization',
'X-Api-Key', // redact this header on every request
SensitiveRequest::class, // redact ALL headers for this request
SensitiveConnector::class, // redact ALL headers for this connector
// '*', // redact ALL headers on every request
],
'excluded_response_headers' => [
'Set-Cookie',
// '*', // redact every response header
// SensitiveConnector::class, // redact all response headers for a connector
// SensitiveRequest::class, // or a single request
],
'excluded_response_body' => [
SensitiveConnector::class, // exclude bodies for a whole connector
SensitiveRequest::class, // or a single request
// '*', // or every response
],
'max_response_size' => 100,
'keep_for_days' => 30,
use Saloon\Barstool\Models\Barstool;
Schedule::command('model:prune', [
'--model' => [Barstool::class],
])->daily();
use Saloon\Barstool\Barstool;
Barstool::context([
'user_id' => auth()->id(),
'tenant_id' => $tenant->id,
]);
// Or add a single key:
Barstool::addContext('job', 'user-sync');