resetForm(); $this->open = true; } public function close(): void { $this->open = false; } public function save(): void { $this->validate(); Goal::create([ 'title' => $this->title, 'description' => $this->description, 'status' => Goal::STATUS_ACTIVE, 'progress' => 0, ]); $this->dispatch('goal-created'); $this->close(); $this->resetForm(); } protected function resetForm(): void { $this->title = ''; $this->description = ''; $this->resetErrorBag(); } public function render() { return view('livewire.modals.new-goal'); } }