A webhook manager for Laravel and Panelis applications.
- Register webhook vendors through configuration
- Generic webhook handlers
- Automatic route registration
- Optional webhook logging
- Queue-based logging
- Composer-based Panelis plugin discovery
- PHP 8.3+
- Laravel 13+
- Filament 5+
Install the package via Composer:
composer require panelis-php/webhookPublish the configuration file:
php artisan vendor:publish --tag=webhook-configPublish the database migrations:
php artisan vendor:publish --tag=webhook-migrationsRun migrations:
php artisan migrateConfigure your webhook vendors in config/webhook.php:
return [
'prefix' => 'webhook',
'vendors' => [
'ping' => [
'handler' => App\Webhook\PingWebhook::class,
],
],
];This configuration automatically registers:
POST /webhook/ping
Create a webhook handler that implements the Webhook contract:
<?php
namespace App\Webhook;
use Illuminate\Http\Request;
use Panelis\Webhook\Contracts\Webhook;
class PingWebhook implements Webhook
{
public function validate(Request $request): void
{
//
}
public function handle(Request $request): mixed
{
return response()->json([
'message' => 'pong',
]);
}
}Webhook requests can be stored by enabling logging for a vendor:
'vendors' => [
'ping' => [
'handler' => App\Webhook\PingWebhook::class,
'store' => true,
],
],Logged requests are stored in the webhook_logs table.
Available fields:
- ulid
- vendor
- event
- status
- payload
- metadata
- exception
- processed_at
Send a test request:
curl -X POST \
http://localhost/webhook/ping \
-H "Content-Type: application/json" \
-d '{"hello":"world"}'Response:
{
"message": "pong"
}- Filament Resource
- Webhook details page
- Retry failed webhooks
- Replay webhook payloads
- Dashboard widgets
- Failed webhook notifications
The MIT License (MIT).