jeffersongoncalves/laravel-webhook-signatures
Http\Middleware, Events, Queue Workers). It integrates seamlessly with Laravel’s request lifecycle, particularly in handling POST payloads from external services.VerifyWebhookSignature), which is ideal for pre-processing webhook requests before they reach business logic. This avoids duplicating verification logic across controllers.Illuminate\Http\Request).webhook_signatures.php for secret keys per service).actingAsWebhook() helpers)..env) and use Laravel’s config('services') caching.X-Signature vs. Authorization header).composer.json for Laravel version constraints; fork if necessary.Phase 1: Proof of Concept (1–2 days)
composer require jeffersongoncalves/laravel-webhook-signatures.config/webhook_signatures.php with secrets for one provider (e.g., Mailgun).Route::post('/webhook/mailgun', [WebhookController::class, 'handle'])
->middleware('webhook.signature:mailgun');
Phase 2: Full Integration (3–5 days)
handleSendGridWebhook()).Log::error).Phase 3: Optimization (1–2 days)
WebhookVerificationJob).laravel/framework version constraint in composer.json (e.g., ^10.0).Illuminate\Support\Facades\Route changes).sendgrid/sendgrid), but payload parsing must match provider docs.WebhookDispatcher service).dispatch(new ProcessWebhook($payload))).php artisan config:clear post-deploy.dd($request->webhook()) to inspect parsed payloads.webhook.signature.failed events are logged with correlation IDs for tracing.X-Signature vs. Authorization).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Invalid signature | Rejected webhook (403) | Retry logic; alert on repeated failures. |
| Missing secret key | All webhooks fail | Use .env with fallback defaults. |
| Provider API changes | Signature format breaks | Subscribe to provider release notes. |
| Queue backlog (async mode) | Delayed processing | Monitor failed_jobs table. |
| Laravel upgrade | Package compatibility break | Test in staging pre-release. |
How can I help you explore Laravel packages today?