src/Http/Controllers/ForgotPasswordController.php
public function showNewPassword($token)
    {
        try {
            $token = decrypt($token);

            [$authorId, $token] = explode('|', $token);

            $author = WinkAuthor::findOrFail($authorId);
        } catch (Throwable $e) {
            return redirect()->route('wink.password.forgot')->with('invalidResetToken', true);
        }

        if (cache('password.reset.'.$authorId) != $token) {
            return redirect()->route('wink.password.forgot')->with('invalidResetToken', true);
        }

        cache()->forget('password.reset.'.$authorId);

        $author->password = \Hash::make($password = Str::random());

        $author->save();

        return view('wink::reset-password', [
            'password' => $password,
        ]);
    }
public function showNewPassword($token)
    {
        try {
            $token = decrypt($token);

            [$authorId, $token] = explode('|', $token);

            $author = WinkAuthor::findOrFail($authorId);
        } catch (Throwable $e) {
            return redirect()->route('wink.password.forgot')->with('invalidResetToken', true);
        }

        if (cache('password.reset.'.$authorId) != $token) {
            return redirect()->route('wink.password.forgot')->with('invalidResetToken', true);
        }

        cache()->forget('password.reset.'.$authorId);

        $author->password = \Hash::make($password = Str::random());

        $author->save();

        return view('wink::reset-password', [
            'password' => $password,
        ]);
    }
public function showNewPassword ( $ token ) { try { $ token = decrypt ( $ token ) ; [ $ authorId , $ token ] = explode ( '|' , $ token ) ; $ author = WinkAuthor :: findOrFail ( $ authorId ) ; } catch ( Throwable $ e ) { return redirect ( ) -> route ( 'wink.password.forgot' ) -> with ( 'invalidResetToken' , true ) ; } if ( cache ( 'password.reset.' . $ authorId ) != $ token ) { return redirect ( ) -> route ( 'wink.password.forgot' ) -> with ( 'invalidResetToken' , true ) ; } cache ( ) -> forget ( 'password.reset.' . $ authorId ) ; $ author -> password = \ Hash :: make ( $ password = Str :: random ( ) ) ; $ author -> save ( ) ; return view ( 'wink::reset-password' , [ 'password' => $ password , ] ) ; }
Show the new password to the user.

@param  string  $token
@return \Illuminate\Http\Response
Show the new password to the user .