public function setPasswordAttribute($password) { $this->attributes['password'] = mcrypt($password); // When the following happens: // $user->password = '******'; // The user password will be a hashed version of that }
/** * Scope Mutator */ public function setPasswordAttribute($password) { $this->attributes['password'] = mcrypt($password); }