route()?->parameter('token'); return view('fo.auth.passwords.reset')->with( ['token' => $token, 'email' => $request->email] ); } protected function resetPassword(CanResetPassword $user, string $password): void { Assert::isInstanceOf($user, Customer::class); $output = $this->executor->execute( $this->resetCustomerPassword, new ResetCustomerPasswordInput($user, $password), ); match ($output->status) { ResetCustomerPasswordStatus::NOT_EMPLOYED => throw new CustomerNotEmployedException(), ResetCustomerPasswordStatus::INVALID_PASSWORD => throw ValidationException::withMessages([ 'error' => sprintf( '%s : %s', trans('validation.attributes.password'), $output->errorMessage ?? '' ), ]), ResetCustomerPasswordStatus::SUCCESS => $this->afterPasswordReset($user, $output->emailVerified), }; } private function afterPasswordReset(Customer $user, bool $emailVerified): void { event(new PasswordReset($user)); if ($emailVerified) { $this->guard()->login($user); } } public function broker(): PasswordBroker { return Password::broker('customers'); } protected function guard(): StatefulGuard { return Auth::guard('frontend'); } protected function redirectTo(): string { return route('fo.pages.home'); } }