From 62b4c7915045713893f16f4b26403b3b27393c8b Mon Sep 17 00:00:00 2001 From: Godfrey M Date: Wed, 25 Jan 2023 16:38:08 -0800 Subject: [PATCH] adds a couple error messages --- app/Http/Livewire/SlackSettingsForm.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/Http/Livewire/SlackSettingsForm.php b/app/Http/Livewire/SlackSettingsForm.php index 42d5a70824..9e7670d218 100644 --- a/app/Http/Livewire/SlackSettingsForm.php +++ b/app/Http/Livewire/SlackSettingsForm.php @@ -4,9 +4,6 @@ namespace App\Http\Livewire; use Livewire\Component; use App\Models\Setting; -use App\Http\Requests\Request; - - class SlackSettingsForm extends Component { @@ -21,10 +18,16 @@ class SlackSettingsForm extends Component 'slack_channel' => 'required_with:slack_endpoint|starts_with:#|nullable', 'slack_botname' => 'string|nullable', ]; + protected $messages = [ + 'slack_endpoint.required_with' => 'Slack endpoint is required', + 'slack_endpoint.starts_with' => 'Slack endpoint must start with https://hooks.slack.com', + + + ]; public function mount(){ - $this->setting= Setting::getSettings(); + $this->setting = Setting::getSettings(); $this->slack_endpoint = $this->setting->slack_endpoint; $this->slack_channel = $this->setting->slack_channel; $this->slack_botname = $this->setting->slack_botname;