status == 1 ? ' Active ' : 'Inactive';
}
public function news():BelongsTo{
return $this->belongsTo(News::class,'news_id','news_id');
}
public function parent(){
return $this->belongsTo(Comments::class,'parent_id');
}
public function subComments(){
return $this->hasMany(Comments::class,'parent_id');
}
public function user(){
return $this->belongsTo(User::class, 'users_id', 'id');
}
}