Skip to main content

Crate spatie_laravel_webhook_client

Crate spatie_laravel_webhook_client 

Source
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.
DatabaseWebhookCallModel
Default persistent storage using Laravel’s configured database connection.
DefaultRespondsTo
Respond with HTTP 200 and {"message":"ok"}.
DefaultSignatureValidator
Verify a lowercase hexadecimal HMAC-SHA256 over the exact request body.
InvalidWebhookSignatureEvent
Emitted before rejecting a webhook with an invalid signature.
ProcessEverythingWebhookProfile
Accept every authenticated webhook.
PruneWebhookCalls
Delete stored calls older than the configured retention period.
QueuedJob
Convert a stored call into an application’s native Laravel queue job.
WebhookCall
Stored webhook, queryable through Laravel’s native query builder.
WebhookConfig
Settings for one named webhook endpoint.
WebhookConfigRepository
Named configurations for applications receiving webhooks from multiple senders.
WebhookProcessor
Validate, filter, store, dispatch, and respond using replaceable policies.

Enums§

Error
Errors returned while accepting, persisting, or dispatching a webhook.
StoreHeaders
Headers retained on a stored webhook. No headers are stored by default.

Traits§

ProcessWebhookJob
Replaceable job dispatch, parameterized by the application’s stored call type.
RespondsToWebhook
Customize responses for authenticated webhooks, including those the profile ignores.
SignatureValidator
Replaceable authentication for incoming webhooks.
WebhookCallModel
Replace the storage model, payload extraction, table, and exception persistence together.
WebhookProfile
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.