File tree 2 files changed +14
-2
lines changed
2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 9
9
},
10
10
"suggest" : {
11
11
"illuminate/database" : " Allows to send request with data from model" ,
12
- "illuminate/pipeline" : " Allows to send response data through pipelines"
12
+ "illuminate/pipeline" : " Allows to send response data through pipelines" ,
13
+ "illuminate/container" : " Required to use pipelines"
13
14
},
14
15
"autoload" : {
15
16
"psr-4" : {
Original file line number Diff line number Diff line change 4
4
5
5
use Ivan770 \HttpClient \Exceptions \PipelineNotAvailable ;
6
6
use Symfony \Component \HttpClient \Exception \JsonException ;
7
+ use Illuminate \Container \Container ;
7
8
use Illuminate \Pipeline \Pipeline ;
8
9
9
10
/**
@@ -18,6 +19,8 @@ class Response
18
19
19
20
protected $ pipeline ;
20
21
22
+ protected $ container ;
23
+
21
24
public function __construct ($ baseResponse )
22
25
{
23
26
$ this ->baseResponse = $ baseResponse ;
@@ -32,10 +35,18 @@ protected function pipelineAvailable()
32
35
throw new PipelineNotAvailable ("Pipeline class cannot be found " );
33
36
}
34
37
38
+ protected function getContainer ()
39
+ {
40
+ if (function_exists ("app " )) {
41
+ $ this ->container = app ();
42
+ }
43
+ return $ this ->container ;
44
+ }
45
+
35
46
protected function getPipeline ()
36
47
{
37
48
if ($ this ->pipelineAvailable () && is_null ($ this ->pipeline )) {
38
- $ this ->pipeline = new Pipeline ();
49
+ $ this ->pipeline = new Pipeline ($ this -> getContainer () );
39
50
}
40
51
return $ this ->pipeline ;
41
52
}
You can’t perform that action at this time.
0 commit comments