Expand description
§Receive webhooks in Laravel Rust
Validate incoming webhook signatures, store calls in your database, and dispatch your own Laravel queue jobs. Replace the signature validator, profile, response, model, or job without replacing the request pipeline.
use spatie_laravel_webhook_client::WebhookConfig;
let config = WebhookConfig::new("payments", "your-signing-secret");
assert_eq!(config.signature_header_name, "Signature");§Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You’ll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
§Documentation
See the documentation for installation, routing, custom models and jobs, attachments, and pruning.
§Installation
cargo add spatie-laravel-webhook-client --features database-sqlite§Testing
cargo test --locked --all-targets --all-features
cargo test --locked --doc --all-features§Changelog
Please see CHANGELOG for more information on what has changed recently.
§Contributing
Please see CONTRIBUTING for details.
§Security vulnerabilities
Please review our security policy on how to report security vulnerabilities.
§Credits
§License
The MIT License (MIT). Please see License File for more information.
Structs§
- Attachment
- Durable upload contents and metadata, independent of the request’s temporary file.
- Config
- Application-wide defaults registered through package-tools.
- Database
Webhook Call Model - Default persistent storage using Laravel’s configured database connection.
- Default
Responds To - Respond with HTTP 200 and
{"message":"ok"}. - Default
Signature Validator - Verify a lowercase hexadecimal HMAC-SHA256 over the exact request body.
- Invalid
Webhook Signature Event - Emitted before rejecting a webhook with an invalid signature.
- Process
Everything Webhook Profile - Accept every authenticated webhook.
- Prune
Webhook Calls - Delete stored calls older than the configured retention period.
- Queued
Job - Convert a stored call into an application’s native Laravel queue job.
- Webhook
Call - Stored webhook, queryable through Laravel’s native query builder.
- Webhook
Config - Settings for one named webhook endpoint.
- Webhook
Config Repository - Named configurations for applications receiving webhooks from multiple senders.
- Webhook
Processor - Validate, filter, store, dispatch, and respond using replaceable policies.
Enums§
- Error
- Errors returned while accepting, persisting, or dispatching a webhook.
- Store
Headers - Headers retained on a stored webhook. No headers are stored by default.
Traits§
- Process
Webhook Job - Replaceable job dispatch, parameterized by the application’s stored call type.
- Responds
ToWebhook - Customize responses for authenticated webhooks, including those the profile ignores.
- Signature
Validator - Replaceable authentication for incoming webhooks.
- Webhook
Call Model - Replace the storage model, payload extraction, table, and exception persistence together.
- Webhook
Profile - Decide whether an authenticated webhook should be stored and processed.
Functions§
- service_
provider - Register configuration and the webhook calls migration, without running it.
Call
.without_migrations()when the application owns the schema.
