'date', ]; /** * Mutator: automatically hash password when set. * Accepts plain text and hashes it with bcrypt. */ public function setPasswordAttribute($value) { if (empty($value)) { return; } // If already hashed (starts with $2y$), don't double-hash if (Hash::needsRehash($value)) { $this->attributes['password'] = Hash::make($value); } else { $this->attributes['password'] = $value; } } /** * Optional helper to get display name (useful in views/logs). */ public function getDisplayNameAttribute() { return $this->name . ' (' . $this->employee_id . ')'; } }