Laravel Webhooks
Laravel package to handle Oh Dear webhooks with automatic signature verification.
Handle Oh Dear Webhooks in Laravel #
Oh Dear can notify your Laravel application of events using webhooks. This package helps you handle those webhooks with ease. Out of the box it will verify the Oh Dear signature of all incoming requests.
Key Features #
- Automatic Signature Verification: All incoming webhook requests are verified to ensure they come from Oh Dear
- Job-based Handling: Define jobs that should be dispatched when specific webhook events arrive
- Event-based Handling: Listen to events the package fires for flexible handling
- Queue Support: Works seamlessly with Laravel's queue system for optimal performance
Installation #
composer require ohdearapp/laravel-ohdear-webhooks
Then publish the config file:
php artisan vendor:publish \ --provider="OhDear\LaravelWebhooks\OhDearWebhooksServiceProvider" \ --tag="config"
Route Setup #
Register the webhook route in your routes file:
Route::ohDearWebhooks('webhook-route-configured-at-the-ohdear-dashboard');
Handling Webhooks with Jobs #
Create a job to handle specific webhook events:
'jobs' => [ 'uptimeCheckFailed' => \App\Jobs\HandleFailedUptimeCheck::class, 'uptimeCheckRecovered' => \App\Jobs\HandleRecoveredUptimeCheck::class, ],
Available Webhook Events #
The package supports all Oh Dear webhook event types including uptime checks, certificate health, broken links, mixed content, scheduled tasks, and more. See the Oh Dear webhooks documentation for a complete list.