Add webhook code and rebuild.

This commit is contained in:
James Cole
2022-09-18 10:45:38 +02:00
parent c4c178b39d
commit 67126e46b9
46 changed files with 905 additions and 96 deletions

View File

@@ -143,6 +143,49 @@ class Webhook extends Model
}
return $array;
}
/**
* @return array
*/
public static function getTriggersForValidation(): array
{
$array = [];
$set = WebhookTrigger::cases();
foreach ($set as $item) {
$array[$item->name] = $item->value;
$array[$item->value] = $item->value;
}
return $array;
}
/**
* @return array
*/
public static function getResponsesForValidation(): array
{
$array = [];
$set = WebhookResponse::cases();
foreach ($set as $item) {
$array[$item->name] = $item->value;
$array[$item->value] = $item->value;
}
return $array;
}
/**
* @return array
*/
public static function getDeliveriesForValidation(): array
{
$array = [];
$set = WebhookDelivery::cases();
foreach ($set as $item) {
$array[$item->name] = $item->value;
$array[$item->value] = $item->value;
}
return $array;
}
/**
* @return array
*/