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>
36 lines
868 B
PHP
36 lines
868 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources\Webhooks\Pages;
|
|
|
|
use App\Filament\Resources\Webhooks\WebhookResource;
|
|
use Filament\Actions\DeleteAction;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
|
|
class EditWebhook extends EditRecord
|
|
{
|
|
protected static string $resource = WebhookResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
WebhookResource::pingAction(),
|
|
WebhookResource::rotateAction(),
|
|
DeleteAction::make(),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Switching it back on starts its failure count again, as through the API.
|
|
*/
|
|
protected function mutateFormDataBeforeSave(array $data): array
|
|
{
|
|
if (($data['is_active'] ?? false) && ! $this->record->is_active) {
|
|
$this->record->consecutive_failures = 0;
|
|
}
|
|
|
|
return $data;
|
|
}
|
|
}
|