adds a couple error messages

This commit is contained in:
Godfrey M 2023-01-25 16:38:08 -08:00
parent a69cb6204a
commit 62b4c79150

View file

@ -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;