[ All integrations ](https://ohdear.app/third-party-integrations)

# Laravel Webhooks

Laravel package to handle Oh Dear webhooks with automatic signature verification.

[ ohdearapp/laravel-ohdear-webhooks ](https://github.com/ohdearapp/laravel-ohdear-webhooks)

by [ Oh Dear ](https://ohdear.app)

## Handle Oh Dear Webhooks in Laravel [\#](#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 [\#](#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 [\#](#installation)

```
<span class="hl-keyword">composer</span> require ohdearapp/laravel-ohdear-webhooks
```

Then publish the config file:

```
<span class="hl-keyword">php</span> <span class="hl-keyword">artisan</span> vendor:publish \
    <span class="hl-attribute">--provider</span>=<span class="hl-value">"OhDear\LaravelWebhooks\OhDearWebhooksServiceProvider"</span> \
    <span class="hl-attribute">--tag</span>=<span class="hl-value">"config"</span>
```

## Route Setup [\#](#route-setup)

Register the webhook route in your routes file:

```
<span class="hl-type">Route</span>::<span class="hl-property">ohDearWebhooks</span>(<span class="hl-value">'webhook-route-configured-at-the-ohdear-dashboard'</span>);
```

## Handling Webhooks with Jobs [\#](#handling-webhooks-with-jobs)

Create a job to handle specific webhook events:

```
<span class="hl-value">'jobs'</span> => [
    <span class="hl-value">'uptimeCheckFailed'</span> => <span class="hl-type">\App\Jobs\HandleFailedUptimeCheck</span>::<span class="hl-keyword">class</span>,
    <span class="hl-value">'uptimeCheckRecovered'</span> => <span class="hl-type">\App\Jobs\HandleRecoveredUptimeCheck</span>::<span class="hl-keyword">class</span>,
],
```

## Available Webhook Events [\#](#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](https://ohdear.app/docs/integrations/webhooks) for a complete list.
