/**
  * Handle the form.
  *
  * @param ForgotPasswordFormBuilder $builder
  * @param UserRepositoryInterface   $users
  * @param UserPassword              $password
  */
 public function handle(ForgotPasswordFormBuilder $builder, UserRepositoryInterface $users, UserPassword $password, Repository $config)
 {
     $user = $users->findByEmail($builder->getFormValue('email'));
     if ($path = $builder->getFormOption('reset_path')) {
         $config->set('anomaly.module.users::paths.reset', $path);
     }
     $password->forgot($user);
     $password->send($user, $builder->getFormOption('reset_redirect'));
 }
 /**
  * Handle the form.
  *
  * @param ForgotPasswordFormBuilder $builder
  * @param UserRepositoryInterface   $users
  * @param UserPassword              $password
  * @param MessageBag                $messages
  * @param Repository                $config
  */
 public function handle(ForgotPasswordFormBuilder $builder, UserRepositoryInterface $users, UserPassword $password, MessageBag $messages, Repository $config)
 {
     if ($builder->hasFormErrors()) {
         return;
     }
     $user = $users->findByEmail($builder->getFormValue('email'));
     if ($path = $builder->getFormOption('reset_path')) {
         $config->set('anomaly.module.users::paths.reset', $path);
     }
     $password->forgot($user);
     $password->send($user, $builder->getFormOption('reset_redirect'));
     $messages->success('anomaly.module.users::message.confirm_reset_password');
 }