How to Implement Sweet Alert in Laravel Application

How to Implement Sweet Alert in Laravel Application

In this Post We Will Explain About is How to Implement Sweet Alert in Laravel Application With Example and Demo.Welcome on – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to How to use Sweet Alert to replace standard confirm dialog Example

In this post we will show you Best way to implement Sweet Alert Messages using laravel, hear for Laravel 5 – confirmation box for delete a member from database example with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Phase 1: Install uxweb/sweet-alert Package

composer require uxweb/sweet-alert

And then successfully this install package, after that open simple path config/app.php file and pur some service provider and alias source code.config/app.php

'providers' => [
'aliases' => [
	'Alert' => UxWeb\SweetAlert\SweetAlert::class,

As above We put simple “Alert” facade We can Display, but we do not any external libs require in this best example, so And then We just put for demo.

Phase 2: Add Route


Route::get('my-livetoaster/{type}', 'LiveController@myLivetoaster');

Phase 3: Create Controller Method

so open your app/Http/Controllers/LiveController.phpfile and add following route.

message('live Sweet Alert with message Good Luck.');
            case 'basic':
                alert()->basic('live Sweet Alert with basic Good Luck.','Basic');
            case 'info':
                alert()->info('live Sweet Alert with info Good Luck.');
            case 'success':
                alert()->success('some Sweet Alert with success Good Luck.','Welcome to')->autoclose(4000);
            case 'error':
                alert()->error('some Sweet Alert with error Good Luck.');
            case 'warning':
                alert()->warning('some Sweet Alert with warning Good Luck.');
                # your code...

        return view('my-livetoaster');

Phase 4: create Blade File

so open your resources/views/my-livetoaster.blade.phpfile and add following route. Laravel Sweet Alert Notification

Laravel Sweet Alert Notification step by step


Live24u is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development. We deliver the useful and best tutorials for web professionals — developers, programmers, freelancers and site owners. Any visitors of this site are free to browse our tutorials, live demos and download scripts.

And then We are ready to some run our best example therefor run bellow some command run:

php artisan serve

And then We can open some bellow url on our browser:

You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
More Details……
Angularjs Example


I hope you have Got What is Laravel 5 – confirmation box for delete a member from database example And how it works.I would Like to have FeedBack From My Blog( readers.Your Valuable FeedBack,Any Question,or any Comments about This Article( Are Most Always Welcome.

Leave a Comment