comments = $comments; $this->comment = $comment; $this->blog_id = $blog_id; // dd($this->comment); } public function render() { return view('livewire.tools.home-comments'); } public function reply($id,$parent_id) { if ($this->comment_message_reply && $this->comment_name_reply){ Comment::create(['name'=>$this->comment_name_reply,'message'=>$this->comment_message_reply,'blog_id'=>$this->blog_id,'ip'=>request()->ip(),'user_agent'=>request()->userAgent(),'parent_id'=>$id,'type'=>2]); Comment::where('id',$parent_id)->increment('reply'); $this->comment_message_reply=null; $this->comment_name_reply=null; } } }