Laravel Redirect To Another URL / Web Page - HTTP Laravel Redirects

Laravel 6 Display Message box

Today, We want to share with you Laravel 6 Display Message box.In this post we will show you alert success message in bootstrap laravel, hear for return redirect back with success message laravel we will give you demo and example for implement.In this post, we will learn about Laravel session flash message include html tag link href blade view with an example.

Laravel 6 Display Message box

There are the Following The simple About Laravel 6 notification message popup using toastr js plugin Full Information With Example and source code.

  Laravel Renaming Uploaded Files Automatically

As I will cover this Post with live Working example to develop laravel 6.2 redirect with success message, so the Confirmation alert box with Laravel 6.2 contact form is used for this example is following below.

Implement Flash Message with Laravel 6.0

There are following alert message will added:

  • 1)success
  • 2)error
  • 3)warning
  • 4)info
  • 5)validation error

in Controller

if ($send_mail) {
    return redirect()
        ->back()
        ->with('success', 'Your Profile has been Updated successfully!');
}

return redirect()
    ->back()
    ->withInput()
    ->with('error', 'Sorry Your Email Address was a Miss Match while sending the message!');

//Laravel 6 Blade View source code
@if (isset($error))
    <div class="col-sm-12">
        <div class="alert  alert-danger alert-dismissible fade show" role="alert">
          $error
                <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
        </div>
    </div>
@endif

Laravel 6 Controller code

session()->put('error', 'Sorry Your Email Address was a Miss Match while sending the message!');

return redirect()
    ->back()
    ->withInput();

//View source Code in header Part
@if (session()->has('error'))
    {{ session('error') }}
@endif

Web Programming Tutorials Example with Demo

Read :

  Angular 6 Responsive Admin Themes & Templates free download

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Return success message to laravel view.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Leave a Reply

avatar
  Subscribe  
Notify of