In this post, we are going to learn to show notify information with an excellent user-friendly look using sweetAlert package in laravel application. Here we are going to use uxweb/sweet-alert package for Display Sweet Alert Notifications in Laravel web application.

SweetAlert Notifications is easy to use a jQuery library and using it we can show pretty notification messages. SweetAlert gives excellent design and an excellent style to open box with a message and we can also use this kind of alerts for successful transactions, warning messages, user information, request confirmation before the process.

Step 1: Install Package

In this step, we need to download and extract uxweb/sweet-alert package using composer. Simply add the package name with version details in a composer.json file and run a composer update command.

and, run the following command
Step 2: Update provider and alias details

After successfully extract the package, Goto config/app.php file and append service provider and alias details with specific classes.

Step 3: Controller with Function details

In this area, we will create a controller with a name of SweetAlertDemo add namespace with a required method. Here alert() method for passing notification information to view page.

Step 4: Define Route

In this step, we are going to add a route for demo with an Notifications alert type argument into routes file and add the following route.

Step 5: View page details

In final, we need to create blade view file and include a sweetAlert jQuery and CSS library detail with notifying methods.

and blade view page as given below,
 

One Reply to “Display Sweet Alert in Laravel using uxweb/sweet-alert”

Leave a Reply

Your email address will not be published. Required fields are marked *