File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,35 @@ You can now run `Swal::fire()` anywhere in your Laravel application (controllers
1717``` php
1818use SweetAlert2\Laravel\Swal;
1919
20+ // same as `Swal.fire()` in JS, same options: https://sweetalert2.github.io/#configuration
2021Swal::fire([
2122 'title' => 'Laravel + SweetAlert2 = <3 ' ,
2223 ' text ' => ' This is a simple alert using SweetAlert2 ' ,
2324 ' icon ' => ' success ' ,
2425 ' confirmButtonText ' => ' Cool '
2526]);
27+
28+ // or with a custom icon
29+ Swal::success([
30+ ' title ' => ' Popup with a success icon ' ,
31+ ]);
32+ Swal::error([
33+ ' title ' => ' Popup with an error icon ' ,
34+ ]);
35+ Swal::warning([
36+ ' title ' => ' Popup with a warning icon ' ,
37+ ]);
38+ Swal::info([
39+ ' title ' => ' Popup with an info icon ' ,
40+ ]);
41+ Swal::question([
42+ ' title ' => ' Popup with a question icon ' ,
43+ ]);
44+
45+ // or toast
46+ Swal::toast([
47+ ' title ' => ' Laravel + SweetAlert2 = <3 ' ,
48+ ]);
2649```
2750
2851The full list of options can be found in the [SweetAlert2 documentation](https://sweetalert2.github.io/#configuration).
You can’t perform that action at this time.
0 commit comments