SweetAlert by t4t5
Require this package, with Composer, in the root directory of your project.
$ composer require artisanry/sweet-alert
And then include the service provider within app/config/app.php
.
Artisanry\SweetAlert\SweetAlertServiceProvider::class
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel PHP Framework</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.0.1/sweetalert.min.css">
</head>
<body>
<div class="container">
<h1>My Page!</h1>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/sweetalert/1.0.1/sweetalert.min.js"></script>
@include('sweet::alert')
</body>
</html>
sweet('Welcome aboard!');
return redirect()->route('dashboard');
sweet()->success('You successfully read this important alert message.');
return redirect()->route('dashboard');
sweet()->info('This alert needs your attention, but it\'s not super important.');
return redirect()->route('dashboard');
sweet()->warning('Better check yourself, you\'re not looking too good.');
return redirect()->route('dashboard');
sweet()->error('Change a few things up and try submitting again.');
return redirect()->route('dashboard');
sweet()->config('title', 'Are you sure?')
->config('text', 'You will not be able to recover this imaginary file!')
->config('type', 'warning')
->config('showCancelButton', true)
->config('confirmButtonColor', '#DD6B55')
->config('confirmButtonText', 'Yes, delete it!')
->config('cancelButtonText', 'No, cancel plx!')
->config('closeOnConfirm', false)
->config('closeOnCancel', false)
->config('showConfirmButton', true)
->config('timer', null)
->callback('function(isConfirm) {
if (isConfirm) {
swal("Deleted!", "Your imaginary file has been deleted.", "success");
} else {
swal("Cancelled", "Your imaginary file is safe :)", "error");
}
}')
->commit();
return redirect()->route('dashboard');
$ phpunit
If you discover a security vulnerability within this package, please send an e-mail to hello@basecode.sh. All security vulnerabilities will be promptly addressed.
This project exists thanks to all the people who contribute.
Mozilla Public License Version 2.0 (MPL-2.0).