After publishing, you can customize the webhook behavior in config/webhook-server.php. Key configuration options include:
queue: The default Laravel queue used for sending requests.http_verb: The HTTP method used (e.g., post).signer: The class responsible for calculating request signatures.signature_header_name: The header name for the signature.timestamp_header_name: The header name for the timestamp.headers: An array of headers to include in every request.timeout_in_seconds: How long to wait before considering an attempt failed.tries: Number of retry attempts.backoff_strategy: The strategy used to determine delay between retries.webhook_job: The job class used to dispatch webhooks.verify_ssl: Whether to verify the destination's SSL certificate.throw_exception_on_failure: Whether to throw an exception when all retries fail.tags: Tags for Laravel Horizon.
return [
/*
* The default queue that should be used to send webhook requests.
*/
'queue' => 'default',
/*
* The default http verb to use.
*/
'http_verb' => 'post',
/*
* This class is responsible for calculating the signature that will be added to
* the headers of the webhook request. A webhook client can use the signature
* to verify the request hasn't been tampered with.
*/
'signer' => \Spatie\WebhookServer\Signer\DefaultSigner::class,
/*
* This is the name of the header where the signature will be added.
*/
'signature_header_name' => 'Signature',
/*
* This is the name of the header where the timestamp will be added.
*/
'timestamp_header_name' => 'Timestamp',
/*
* These are the headers that will be added to all webhook requests.
*/
'headers' => [],
/*
* If a call to a webhook takes longer this amount of seconds
* the attempt will be considered failed.
*/
'timeout_in_seconds' => 3,
/*
* The amount of times the webhook should be called before we give up.
*/
'tries' => 3,
/*
* This class determines how many seconds there should be between attempts.
*/
'backoff_strategy' => \Spatie\WebhookServer\BackoffStrategy\ExponentialBackoffStrategy::class,
/*
* This class is used to dispatch webhooks onto the queue.
*/
'webhook_job' => \Spatie\WebhookServer\CallWebhookJob::class,
/*
* By default we will verify that the ssl certificate of the destination
* of the webhook is valid.
*/
'verify_ssl' => true,
/*
* When set to true, an exception will be thrown when the last attempt fails
*/
'throw_exception_on_failure' => false,
/*
* When using Laravel Horizon you can specify tags that should be used on the
* underlying job that performs the webhook request.
*/
'tags' => [],
];