hasOne(Admin::class, 'id', 'created_by')->select('id', 'real_name as created_name'); } public function updateds(): HasOne { return $this->hasOne(Admin::class, 'id', 'updated_by')->select('id', 'real_name as updated_name'); } public function getCreatedNameAttribute(): string { return $this->createds?->created_name ?? ''; } public function getUpdatedNameAttribute(): string { return $this->updateds?->updated_name ?? ''; } }