Skip to content

Commit 0118ee6

Browse files
committed
chore: add docs
1 parent cbc7b9f commit 0118ee6

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,35 @@ You can now run `Swal::fire()` anywhere in your Laravel application (controllers
1717
```php
1818
use SweetAlert2\Laravel\Swal;
1919

20+
// same as `Swal.fire()` in JS, same options: https://sweetalert2.github.io/#configuration
2021
Swal::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
2851
The full list of options can be found in the [SweetAlert2 documentation](https://sweetalert2.github.io/#configuration).

0 commit comments

Comments
 (0)