I got too many requests for adding confirmation alerts feature to realrashid/sweet-alert package this realrashid/sweet-alert/issues/57 is one of the earliest request for adding confirmation alerts feature but unfortunately i haven’t added this feature yet because i haven’t found the best way to achieve this.

So Today I found an easy way to do this without adding the support for this feature in realrashid/sweet-alert package with the help of Livewire 🎉

So without any further due Let’s Begin 🔥

First Install the realrashid/sweet-alert package in your project if not installed yet 😢

composer require realrashid/sweet-alert

Then configure the package.

Include 'sweetalert::alert'


Laravel SweetAlert 2 is a Laravel package that integrates the popular JavaScript SweetAlert 2 with Laravel.

Using the package’s Alert facade or alert() helper, you can queue up SweetAlert 2 alerts on the frontend from your controller:

It so easy to implement and easy to use give a shot and leave your thoughts.

Install

To get started with Laravel SweetAlert,
use Composer to add the package to your project's dependencies:

 composer require realrashid/sweet-alert

Alert

  • alert(‘Title’,’Lorem Lorem Lorem’, ‘success’);
  • alert()->success('Title','Lorem Lorem Lorem');
  • alert()->info('Title','Lorem Lorem Lorem');
  • alert()->warning('Title','Lorem Lorem Lorem');
  • alert()->question('Title','Lorem Lorem Lorem');
  • alert()->error('Title','Lorem Lorem Lorem');
  • alert()->html('<i>HTML</i> <u>example</u>'," You can use <b>bold text</b>, <a…

Rashid Ali

Creator 0f 9Webb a Full Stack Developer, an Artisan lover. I live in a small town somewhere in the world.I am passionate about Web and Mobile apps development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store