Manage webhooks from the panel
Create one and see its secret once, send a test, change the secret, and read each delivery with what the other end answered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,8 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Http\Requests\Api\V1;
|
||||
|
||||
use App\Models\Webhook;
|
||||
use App\Support\Webhooks\PublicEndpoint;
|
||||
use Closure;
|
||||
use App\Rules\PublicHttpsUrl;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
@@ -34,13 +33,7 @@ class WebhookRequest extends FormRequest
|
||||
'max:2048',
|
||||
// Refused now rather than at the first delivery; checked
|
||||
// again at every delivery all the same.
|
||||
function (string $attribute, mixed $value, Closure $fail): void {
|
||||
[, $reason] = app(PublicEndpoint::class)->check((string) $value);
|
||||
|
||||
if ($reason !== null) {
|
||||
$fail(__("rules.media.remote.{$reason}"));
|
||||
}
|
||||
},
|
||||
new PublicHttpsUrl,
|
||||
],
|
||||
'events' => [$sometimes, 'array', 'min:1'],
|
||||
'events.*' => ['string', 'distinct', Rule::in(['*', ...Webhook::EVENTS])],
|
||||
|
||||
Reference in New Issue
Block a user