/
dimamir
/
coolify
Обзор
Документация
Войти
/
dimamir
/
coolify
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
app/Livewire/Project/Shared/Webhooks.php
64 строки
2 KB
Andras Bacsai
refactor: Update Webhooks.php to use nullable type for webhook URLs
12 июл 2024, 14:54
12 июл 2024, 14:54
5778466
Код
Авторство
О чём код?
<?php namespace App\Livewire\Project\Shared; use Livewire\Component; // Refactored ✅ class Webhooks extends Component { public $resource; public ?string $deploywebhook; public ?string $githubManualWebhook; public ?string $gitlabManualWebhook; public ?string $bitbucketManualWebhook; public ?string $giteaManualWebhook; public ?string $githubManualWebhookSecret = null; public ?string $gitlabManualWebhookSecret = null; public ?string $bitbucketManualWebhookSecret = null; public ?string $giteaManualWebhookSecret = null; public function mount() { // ray()->clearAll(); // ray()->showQueries(); $this->deploywebhook = generateDeployWebhook($this->resource); $this->githubManualWebhookSecret = data_get($this->resource, 'manual_webhook_secret_github'); $this->githubManualWebhook = generateGitManualWebhook($this->resource, 'github'); $this->gitlabManualWebhookSecret = data_get($this->resource, 'manual_webhook_secret_gitlab'); $this->gitlabManualWebhook = generateGitManualWebhook($this->resource, 'gitlab'); $this->bitbucketManualWebhookSecret = data_get($this->resource, 'manual_webhook_secret_bitbucket'); $this->bitbucketManualWebhook = generateGitManualWebhook($this->resource, 'bitbucket'); $this->giteaManualWebhookSecret = data_get($this->resource, 'manual_webhook_secret_gitea'); $this->giteaManualWebhook = generateGitManualWebhook($this->resource, 'gitea'); } public function submit() { try { $this->authorize('update', $this->resource); $this->resource->update([ 'manual_webhook_secret_github' => $this->githubManualWebhookSecret, 'manual_webhook_secret_gitlab' => $this->gitlabManualWebhookSecret, 'manual_webhook_secret_bitbucket' => $this->bitbucketManualWebhookSecret, 'manual_webhook_secret_gitea' => $this->giteaManualWebhookSecret, ]); $this->dispatch('success', 'Secret Saved.'); } catch (\Exception $e) { return handleError($e, $this); } } }