DEV Community


How To Use Sweetalert2 In Laravel

I am Laravel Developer. I have good knowledge of JavaScript, JQuery, Bootstrap and REST API.
Originally published at ・2 min read

Today we will learn how to use sweetalert2 In laravel, You can use sweetalert2 in laravel as well as php, sweetalert2 is used for create different type of custom alert messages or you can create custom popups like success messages, error messages, warning modals, confirm modals, custom notifications etc..

Normally, javascript provide simple alert box in your browser but if you want to dispaly custom popup then sweetalert2 is very effective library which allows us to create all kinds of alert messages that can be customized to match the look and feel of our own website.

So, let's start and see how to implement sweetalert2 In laravel.

Step 1 : Download or Install Using CDN 
Step 2 : Call the sweetAlert2
Enter fullscreen mode Exit fullscreen mode

We are cover different example in the post like :

  • Example 1 : Simple message
  • Example 2 : Title with text
  • Example 3 : Modal with title, icon, text and footer
  • Example 4 : Modal window with a long content
  • Example 5 : Custom HTML description and buttons with ARIA labels
  • Example 6 : Dialog with three buttons
  • Example 7 : Custom positioned
  • Example 8 : Confirm dialog box with a confirm button
  • Example 9 : Modal with a custom image
  • Example 10 : Model with autoclose timer any much more.

Read More : How To Use Sweetalert2 In Laravel

You May Also Like :

  1. Read More : Laravel 8 cURL HTTP Request Example
  2. Read More : Google Map With Draggable Marker Example
  3. Read More : How To Validate 10 Digit Mobile Number Using Regular Expression

Discussion (0)