Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Jsanwo64's avatar

Session message not showing after resending Email verification Link

I noticed that after clicking the "Resend Verification" Button no session is sent back to the verify/email page.

here is the code in auth/verify

@extends('layouts.auth')

@section('content')


<div class="signUP-admin">
    <div class="container-fluid">
        <div class="row justify-content-center">
            <div class="col-xl-4 col-lg-5 col-md-5 p-0">
                <div class="signUP-admin-left position-relative h-100vh">

                    <div class="signUP-admin-left__content">
                        <div class="text-capitalize mb-md-30 mb-15 d-flex align-items-center justify-content-md-start justify-content-center">
                            <a class="wh-36 bg-primary text-white radius-md mr-10 content-center" href="{{ route('landing_page') }}">LL</a>
                            <span class="text-dark">LASU LAPES</span>
                        </div><br>
                        <h1 style="text-align: ">Complete Your Email Verification</h1>
                    </div>
                    <div class="signUP-admin-left__img"><br><br>
                        <img class="img-fluid svg" src="/dash/img/verification.png" alt="img" />
                    </div>
                </div><!-- End: .signUP-admin-left -->
            </div><!-- End: .col -->
            <div class="col-xl-8 col-md-7 col-sm-8">
                <div class="signUp-admin-right content-center h-100 pb-30">
                    <div class="row justify-content-center">
                        <div class="col-md-8 col-sm-10">
                            <div class="edit-profile mt-0">
                                <div class="card border-0">
                                    <div class="card-header border-0 pt-0 pb-0">
                                        <div class="signUp-header-top mt-md-0 mt-30">

                                            <h6>Hi {{ Auth::user()->name }}, Please {{ __('Verify Your Email Address') }}</h6>

                                        </div>
                                    </div>
                                    <div class="card-body pt-20 pb-0">
                                        @if (session('resent'))
                                        <div class="alert alert-danger" role="alert">
                                            {{ __('A fresh verification link has been sent to your email address.') }}
                                        </div>
                                    @endif

                                    {{ __('Thanlks for signing up. Before getting started, could you verify your email address by clicking on the link we just emailed to you?') }}
                                    {{ __('If you did not receive the email, we will gladly send you another.') }},
                                    <form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
                                        @csrf
                                        <br><br>
                                        <button type="submit" class="btn btn-primary btn-default btn-squared text-capitalize lh-normal px-md-50 py-15 signIn-createBtn">{{ __('RESEND VERIFICATION EMAIL') }}</button>.
                                    </form>
                                    <p class="mb-0 fs-14 fw-500 text-gray text-capitalize">

                                        @guest
                                        @if (Route::has('login'))

                                                <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>

                                        @endif

                                        @if (Route::has('register'))

                                                <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>

                                        @endif
                                        @else
                                                <a  href="{{ route('logout') }}"
                                                   onclick="event.preventDefault();
                                                                 document.getElementById('logout-form').submit();">
                                                  Click to  {{ __('Logout') }}
                                                </a>

                                                <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
                                                    @csrf
                                                </form>

                                        @endguest
                                    </p>
                                    </div>

                                </div><!-- End: .card -->
                            </div><!-- End: .edit-profile -->
                        </div><!-- End: col -->
                    </div>
                </div><!-- End: .signUp-admin-right -->
            </div><!-- End: .col -->
        </div>
    </div>
</div><!-- End: .signUP-admin -->


@endsection

0 likes
5 replies
n212's avatar

I suspect the problem is in the controller where verification.resend route points to. Are you sure you named your session correctly?

Jsanwo64's avatar

@n212 this is what i have


    /**
     * Resend the email verification notification.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\RedirectResponse
     */
    public function resend(Request $request)
    {
        if ($request->user()->hasVerifiedEmail()) {
            return $request->wantsJson()
                        ? new JsonResponse([], 204)
                        : redirect($this->redirectPath());
        }

        $request->user()->sendEmailVerificationNotification();

        return $request->wantsJson()
                    ? new JsonResponse([], 202)
                    : back()->with('resent', true);
    }
}

Sinnbeck's avatar

I assume all routes are in web.php and not api.php?

Jsanwo64's avatar

All routes are in web.php

the routes are below


Route::get('/email/verify', function () {
    return view('auth.verify');
})->middleware('auth')->name('verification.notice');


Route::get('/email/verify/{id}/{hash}', function (EmailVerificationRequest $request) {
    $request->fulfill();

    return redirect('/home');
})->middleware(['auth', 'signed'])->name('verification.verify');



Route::post('/email/verification-notification', function (Request $request) {
    $request->user()->sendEmailVerificationNotification();

    return back()->with('message', 'Verification link sent!');
})->middleware(['auth', 'throttle:6,1'])->name('verification.send');


Please or to participate in this conversation.