1

I need to redirect back with a message.

Active link sent successfully.

<a href="{{ route('verification.resend') }}">request another</a>

How do I create a session to link if I'm not using any form?

Karl Hill
  • 12,937
  • 5
  • 58
  • 95

1 Answers1

2

If you check how Laravel handles this feature in VerifiesEmail::resend()

/**
 * Resend the email verification notification.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function resend(Request $request)
{
    if ($request->user()->hasVerifiedEmail()) {
        return redirect($this->redirectPath());
    }

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

    return back()->with('resent', true);
}

You will also notice that on a successful action, it is returning back with a resent key in your session.

So, in your blade file you could just do this.

@if (Session::has('resent'))
    <div class="alert alert-success">Your activation link has been sent successfully</div>
@endif  
Mozammil
  • 8,520
  • 15
  • 29