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