belongsTo(Blog::class); } public function parentComment(): BelongsTo { return $this->belongsTo(Comment::class, 'comment_id'); } public function replies(): HasMany { return $this->hasMany(Comment::class, 'comment_id'); } protected $casts = [ 'blog_id' => 'integer', 'comment_id' => 'integer', 'status' => 'integer' ]; }