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); $shopper = $this->shopperService->getShopperFor($user->getId()); if (! $shopper || ! $shopper->isActive()) { throw new CustomerNotEmployedException(); } $this->setUserPassword($user, $password); $user->setRememberToken(Str::random(60)); $user->save(); event(new PasswordReset($user)); if ($this->authService->hasVerifiedEmail($user)) { $this->guard()->login($user); } } protected function setUserPassword(Customer $customer, string $password): void { $result = $this->authService->resetPasswordFor($customer, $password); if ($result instanceof ValidationException) { throw ValidationException::withMessages([ 'error' => sprintf( '%s : %s', trans('validation.attributes.password'), $result->getMessage() ), ]); } } 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'); } }