ohdearapp/laravel-ohdear-webhooks
Laravel package to receive and verify Oh Dear webhooks. Easily register routes, validate signatures, and handle downtime, Uptime, broken links, and other monitoring events with customizable jobs/listeners so your app can react automatically to incidents.
Queue, Broadcasting, or Notifications). It aligns well with microservices or modular architectures where webhook handling is decoupled from core business logic.VerifyOhDearWebhook), reducing boilerplate in route definitions.OhDearWebhook service, OhDearWebhookEvent listeners), allowing for easy extraction if needs change.dispatch(new OhDearWebhookEvent($payload)))..env for webhook secret validation, reducing hardcoded dependencies.OHDEAR_WEBHOOK_SECRET could expose endpoints to spoofing. Risk mitigated by Laravel’s built-in hash_hmac validation.payload_schema_validator trait or middleware to enforce expected fields.webhook_attempts table or use Laravel’s unique() rule in a webhook_log table.afterCommit hooks or batch processing for critical paths.mockswebhooks.com or Laravel’s HttpTests.)incident_type)?EventDispatcher).webhooks.test route with the package’s VerifyOhDearWebhook middleware.https://webhook.test).OhDearWebhook::parse($request).OhDearWebhookEvent.OhDearWebhookEvent::dispatch()->onQueue('webhooks')).handleSslExpiry()).Illuminate\Support\Facades\Event.openssl for HMAC validation (enabled by default in Laravel).laravel-webhook-client), but test with composer why-not ohdearapp/laravel-ohdear-webhooks./webhooks/ohdear endpoint.OHDEAR_WEBHOOK_SECRET in .env (matching Oh Dear’s configured secret).app/Http/Kernel.php:
'webhook' => \OhDearApp\LaravelOhDearWebhooks\Middleware\VerifyOhDearWebhook::class,
Route::post('/webhooks/ohdear', [OhDearWebhookController::class, 'handle']);
EventServiceProvider:
protected $listen = [
OhDearWebhookEvent::class => [
HandleSslAlerts::class,
QueueWebhookForReview::class,
],
];
assertEquals('ssl_expiry', $event->incident_type)).ohdearapp/laravel-ohdear-webhooks for releases (MIT license allows forks if needed).composer update ohdearapp/laravel-ohdear-webhooks.WEBHOOK_HANDLERS.md.OHDEAR_WEBHOOK_SECRET in .env.failed_jobs table for exceptions.dd($event) in listeners.incident_type = "outage").webhook_log table with unique(webhook_id, signature) to prevent duplicates.afterCommit or retryAfter to limit webhook processing rate.json_decode($payload, true) for large responses.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Webhook secret leakage | Unauthorized spoofing | Rotate secrets via Oh Dear dashboard; use Laravel’s env() caching cautiously. |
| Queue worker crashes | Missed alerts | Implement dead-letter queues; use retryAfter delays. |
How can I help you explore Laravel packages today?