hasOne('App\User','id','user_id'); } public static function getAllComments(){ return PostComment::with('user_info')->paginate(10); } public static function getAllUserComments(){ return PostComment::where('user_id',auth()->user()->id)->with('user_info')->paginate(10); } public function post(){ return $this->belongsTo(Post::class,'post_id','id'); } public function replies(){ return $this->hasMany(PostComment::class,'parent_id')->where('status','active'); } }