Skip to content

Commit 797b4db

Browse files
Update helpers.md (#10681)
* Update helpers.md If you have the swoole PHP extension installed, Laravel's defer() helper may conflict with the global defer() provided by Swoole. Would be great to have this warning in the docs. * Update helpers.md --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent 57ded95 commit 797b4db

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

helpers.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3224,6 +3224,9 @@ By default, deferred functions will only be executed if the HTTP response, Artis
32243224
defer(fn () => Metrics::reportOrder($order))->always();
32253225
```
32263226

3227+
> [!WARNING]
3228+
> If you have the **swoole** PHP extension installed, Laravel's `defer` function may conflict with Swoole's own global `defer` function, leading to web server errors. Make sure you call Laravel's `defer` helper by explicitly namespacing it: `use function Illuminate\Support\defer;`
3229+
32273230
<a name="cancelling-deferred-functions"></a>
32283231
#### Cancelling Deferred Functions
32293232

0 commit comments

Comments
 (0)