Package Data | |
---|---|
Maintainer Username: | RaymondWilkinson |
Maintainer Contact: | eleray13@hotmail.com (Raymond Wilkinson) |
Package Create Date: | 2016-05-02 |
Package Last Update: | 2016-06-21 |
Language: | CSS |
License: | MIT |
Last Refreshed: | 2024-12-15 15:09:44 |
Package Statistics | |
---|---|
Total Downloads: | 1,611 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 2 |
Total Forks: | 1 |
Total Open Issues: | 0 |
Simple way to flash sweetalert messages to the screen for laravel.
Simple way to flash sweetalert messages to the screen for laravel.
##Installation
composer require raymondwilkinson/sweetalert-laravel
After install this package you have to set the service provider on your config/app.php file
RaymondWilkinson\SweetalertLaravel\AlertServiceProvider::class,
Copy the required assets of SweetAlert to your public folder. Those assets would be placed in the css and js directories respectively.
php artisan vendor:publish --tag=alerts
Then in your master view add those styles and scripts. Put this style between the tags
<link rel="stylesheet" type="text/css" href="css/sweetalert.css">
Add the JS script before close your tag.
<script src="js/sweetalert.min.js"></script>
Include the alerts view to your master view. Add this code right after set the JS script file.
@include('Alerts::sweetalerts')
###Usage
Your controllers are a perfect place to use it.
flash('Title', 'Message')
flash()->error('Title', 'Message')
flash()->success('Title', 'Message')
flash()->overlay('Title', 'Message')
###SweetAlert website
http://t4t5.github.io/sweetalert/