Send signed outgoing webhooks

Fed by the records themselves, delivered only to public HTTPS addresses
checked at every attempt, retried, and switched off after repeated failures.
A submitter's details travel only to webhooks that opted into them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-01 09:42:39 +02:00
parent f93775e549
commit 9bdbf834f6
23 changed files with 1325 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace App\Models;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
/**
* One attempt to tell a webhook about one event, and how it went.
*/
#[Fillable(['uuid', 'event', 'payload', 'status', 'attempts', 'response_status', 'error', 'delivered_at'])]
class WebhookDelivery extends Model
{
public const PENDING = 'pending';
public const SUCCEEDED = 'succeeded';
public const FAILED = 'failed';
protected function casts(): array
{
return [
'payload' => 'array',
'attempts' => 'integer',
'response_status' => 'integer',
'delivered_at' => 'datetime',
];
}
/**
* @return BelongsTo<Webhook, $this>
*/
public function webhook(): BelongsTo
{
return $this->belongsTo(Webhook::class);
}
}