'boolean', 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; /** Profile owner */ public function profileUser(): BelongsTo { return $this->belongsTo(User::class, 'profile_user_id'); } /** Comment author */ public function author(): BelongsTo { return $this->belongsTo(User::class, 'author_user_id'); } public function authorProfile(): BelongsTo { return $this->belongsTo(UserProfile::class, 'author_user_id', 'user_id'); } /** Scope: only active (not removed) comments */ public function scopeActive($query) { return $query->where('is_active', true); } }