isChecked = !$this->isChecked; } public function save() { $this->validate([ 'body' => 'required|min:3', 'grade' => 'required', ]); $comment = new RecipeComment(); $comment->grade = $this->grade; $comment->body = $this->body; $comment->recipe_id = $this->recipe->id; $comment->user_id = $this->user->id; $comment->save(); $this->reset(['body', 'grade']); $this->toggle(); $this->dispatch('commentAdded')->to('recipe.comment.show'); } }