mardi 16 octobre 2018

Laravel error message if email is not registered during password reset

I recently upgraded my laravel 5.6 project to laravel 5.7, I am experiencing an issue right after I upraded to laravel 5.7. when I enter a registered email, password reset email is sent successfully and the correponding session status message is displayed in the page but when I enter a non registered email the $errors->first('email') displays passwords.user instead if displaying Email is not registered .

How do I solve this problem???

auth/passwords/email.blade.php:

<form action="" class="forgot_Form text-center" method="POST" id="forgot_password">
            @csrf
            <div class="form-group">
                <input type="email" class="form-control email" name="email" id="email" placeholder="Email" value="">
                @if ($errors->has('email'))
                    <span class="label label-danger">
                        <strong></strong>
                    </span>
                @endif
            </div>
            <button type="submit" class="btn submit-btn">
                Send Password Reset Link
            </button>
        </form>

ForgotPasswordController.php:

class ForgotPasswordController extends Controller
{
    /*
    |--------------------------------------------------------------------------
    | Password Reset Controller
    |--------------------------------------------------------------------------
    |
    | This controller is responsible for handling password reset emails and
    | includes a trait which assists in sending these notifications from
    | your application to your users. Feel free to explore this trait.
    |
    */

    use SendsPasswordResetEmails;

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('guest');
    }
}

Result:

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire