resetErrorBag(); $user = Auth::user(); if ($user->password !== null) { parent::updatePassword($updater); } else { // User has a null password. Allow them to set a new password without their current password. Validator::make($this->state, [ 'password' => $this->passwordRules(), ])->validateWithBag('updatePassword'); auth()->user()->forceFill([ 'password' => Hash::make($this->state['password']), ])->save(); $this->state = [ 'current_password' => '', 'password' => '', 'password_confirmation' => '', ]; $this->dispatch('saved'); } } }