Closed RicardoRamirezR closed 10 years ago
This way is used here:
private function autoHash() { if (isset($this->attributes['password'])) { if ($this->attributes['password'] != $this->getOriginal('password')) $this->attributes['password'] = Hash::make($this->attributes['password']); } }
$this->attributes['password'] is the new one in plain, right? $this->getOriginal('password') is the old one hashed, right?
wouldn't be better to use:
if ( ! Hash::check($this->attributes['password'], $this->getOriginal('password'))) { $this->attributes['password'] = Hash::make($this->attributes['password']); }
Nooo, I'm missing something, right?
As autoHash() is private I can't overwrite it...
Hmm, yeah your way looks right to me. I can't really remember why it was written like that in the first place tbh.
This way is used here:
$this->attributes['password'] is the new one in plain, right? $this->getOriginal('password') is the old one hashed, right?
wouldn't be better to use:
Nooo, I'm missing something, right?
As autoHash() is private I can't overwrite it...