File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -57,3 +57,23 @@ $client->setModel($model)->fetchModel()->post("https://example.com");
57
57
// You can also use short variant
58
58
$client->fetchModel($model)->post("https://example.com");
59
59
```
60
+
61
+ ### Data pipelining
62
+ If ` illuminate/pipeline ` is installed, you can send your data through pipelines.
63
+ If not, you can still pass your data to [ Closure] ( https://www.php.net/manual/en/class.closure.php )
64
+ ``` php
65
+ $response = $client->get("https://example.com");
66
+
67
+ // Pass data to Closure
68
+ $response->then(function ($data) {
69
+ return $data;
70
+ });
71
+
72
+ // Use Laravel pipelines
73
+ $pipes = [
74
+ ExamplePipe::class
75
+ ];
76
+ $response->pipeline()->through($pipes)->then(function ($data) {
77
+ return $data;
78
+ });
79
+ ```
You can’t perform that action at this time.
0 commit comments