public function setPasswordAttribute($value) { if (!\Request::has('password')) { if ($value) { $this->attributes['password'] = $value; } else { $this->attributes['password'] = $this->password; } } else { $this->attributes['password'] = \Hash::make(\Request::get('password')); } }