🍩 SweetAlert 2 Implementation for Laravel
MIT License
Install Sweetalert through composer and run our installer.
composer require wavey/sweetalert && php artisan sweetalert:install
Include the Sweetalert2 javascript and then include our sweetalert 2 components.
<script src="//cdn.jsdelivr.net/npm/sweetalert2@11"></script>
@include('sweetalert::sweetalert')
Before using Sweetalerts, you will need to include the sweetalert facade at the top of your controllers:
use Wavey\Sweetalert\Sweetalert;
Now you should have access to the Sweetalert
facade inside your controllers. Their is many varients of the alerts you can use:
Sweetalert::basic('Description', 'Title');
Sweetalert::info('Description', 'Title');
Sweetalert::success('Description', 'Title');
Sweetalert::error('Description', 'Title');
Sweetalert::warning('Description', 'Title');
Sweetalert::message('Description', 'Title');
Sweetalert::message('Description <h2>Custom HTML</h2>', 'Title')->html();
If you want to say thank you and/or support the active development of Sweetalerts
:
Please review our security policy on how to report security vulnerabilities.
Copyright (c) 2022-present Wavey Group and Contributors. Sweetalert
is free and open-source software licensed under the MIT License.