prajakta prajakta - 1 year ago 50
PHP Question

Sucess message is not getting displayed in laravel

I want to show a success message once the email is sent after redirected to same page. Here is my code :

return redirect('currentshowreport?showid='.$show_id)->with('success','Email sent successfully');

I am getting redirected to the specified page but the success message is not getting displayed. How to achieve this?

Answer Source

Try this:

@if (session('success'))
    <div class="alert alert-success">
        {{ session('success') }}