/** * Send a password reminder to a user. * * @param array $credentials * @param Closure $callback * @return \Illuminate\Http\RedirectResponse */ public function remind(array $credentials, Closure $callback = null) { // First we will check to see if we found a user at the given credentials and // if we did not we will redirect back to this current URI with a piece of // "flash" data in the session to indicate to the developers the errors. $user = $this->getUser($credentials); if (is_null($user)) { return $this->makeErrorRedirect('user'); } // Once we have the reminder token, we are ready to send a message out to the // user with a link to reset their password. We will then redirect back to // the current URI having nothing set in the session to indicate errors. $token = $this->reminders->create($user); $this->sendReminder($user, $token, $callback); return $this->redirect->refresh()->with('success', true); }