Skip to content

Commit 3d3f080

Browse files
adi64taylorotwell
andauthored
[8.x] Add note to 'Dispatching Batches' chapter to not use $this in callbacks (#7466)
* Add note to 'Dispatching Batches' chapter to not use `$this` in callbacks. See laravel/framework#38573 * Update queues.md Co-authored-by: Taylor Otwell <[email protected]>
1 parent 0dfe237 commit 3d3f080

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

queues.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,8 @@ To dispatch a batch of jobs, you should use the `batch` method of the `Bus` faca
11821182

11831183
The batch's ID, which may be accessed via the `$batch->id` property, may be used to [query the Laravel command bus](#inspecting-batches) for information about the batch after it has been dispatched.
11841184

1185+
> {note} Since batch callbacks are serialized and executed at a later time by the Laravel queue, you should not use the `$this` variable within the callbacks.
1186+
11851187
<a name="naming-batches"></a>
11861188
#### Naming Batches
11871189

0 commit comments

Comments
 (0)