Skip to content

Commit f7e4066

Browse files
Document the thenReturn method on helpers Pipeline (#10565)
1 parent 7b8ff9a commit f7e4066

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

helpers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3297,7 +3297,7 @@ $user = Pipeline::send($user)
32973297

32983298
As you can see, each invokable class or closure in the pipeline is provided the input and a `$next` closure. Invoking the `$next` closure will invoke the next callable in the pipeline. As you may have noticed, this is very similar to [middleware](/docs/{{version}}/middleware).
32993299

3300-
When the last callable in the pipeline invokes the `$next` closure, the callable provided to the `then` method will be invoked. Typically, this callable will simply return the given input.
3300+
When the last callable in the pipeline invokes the `$next` closure, the callable provided to the `then` method will be invoked. Typically, this callable will simply return the given input. For convenience, if you simply want to return the input after it has been processed, you may use the `thenReturn` method.
33013301

33023302
Of course, as discussed previously, you are not limited to providing closures to your pipeline. You may also provide invokable classes. If a class name is provided, the class will be instantiated via Laravel's [service container](/docs/{{version}}/container), allowing dependencies to be injected into the invokable class:
33033303

@@ -3308,7 +3308,7 @@ $user = Pipeline::send($user)
33083308
ActivateSubscription::class,
33093309
SendWelcomeEmail::class,
33103310
])
3311-
->then(fn (User $user) => $user);
3311+
->thenReturn();
33123312
```
33133313

33143314
<a name="sleep"></a>

0 commit comments

Comments
 (0)