token = $token; $this->email = (string) request()->query('email', ''); } /** * NOT called reset(): Livewire\Component::reset() clears properties, and * a component that redeclares it will not load at all. */ public function save(): void { $this->validate(); $status = Password::broker()->reset( [ 'email' => $this->email, 'password' => $this->password, 'password_confirmation' => $this->password_confirmation, 'token' => $this->token, ], function (User $user, string $password) { $user->forceFill([ 'password' => Hash::make($password), // Every existing session dies with it. Whoever knew the old // password may still be signed in somewhere, and a reset // that leaves them there has fixed nothing. 'remember_token' => Str::random(60), ])->save(); event(new PasswordReset($user)); }, ); if ($status !== Password::PASSWORD_RESET) { $this->addError('email', __($status)); return; } $this->done = true; } public function render() { return view('livewire.auth.reset-password'); } }