public function rehashPasswordIfNeeded($password) { if (!Password::needsRehash($this->password)) { return false; } $this->password = Password::hash($password); return true; }