You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,15 @@ Simple and straightforward:
86
86
- The `Swal::fire()` method will pass the options to the [flashed session](https://laravel.com/docs/12.x/session#flash-data).
87
87
- The blade partial template will check if there are any flashed session data and will render the SweetAlert2 popup.
88
88
89
-
### 3. Any limitations?
89
+
### 3. How does the SweetAlert2 JavaScript library loading work?
90
+
91
+
This package uses a smart loading strategy for the SweetAlert2 library:
92
+
93
+
1. **Check for existing SweetAlert2**: If `window.Swal` is already available, it will use the existing instance.
94
+
95
+
2. **Dynamic CDN loading**: If SweetAlert2 is not loaded, it will dynamically import it from the official CDN (`https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.esm.all.min.js`).
96
+
97
+
### 4. Any limitations?
90
98
91
99
SweetAlert2 is a JavaScript package and some of its options are JS callbacks. It'snotpossibletousetheminthe`Swal::fire()`method.
0 commit comments