@@ -74,6 +74,7 @@ protected function dataCleanUp(array $data): array
74
74
*/
75
75
protected function get (string $ route , array $ data = [], array $ replace = []): Response
76
76
{
77
+ $ data = array_merge ($ replace , $ data );
77
78
$ route = $ this ->makeReplacements ($ route , $ replace );
78
79
$ route = str_replace ('{path} ' , 'app/Models ' , $ route );
79
80
$ data = $ this ->dataCleanUp ($ data );
@@ -86,6 +87,7 @@ protected function get(string $route, array $data = [], array $replace = []): Re
86
87
*/
87
88
protected function post (string $ route , array $ data = [], array $ replace = [], string $ method = 'post ' ): Response
88
89
{
90
+ $ data = array_merge ($ replace , $ data );
89
91
$ route = $ this ->makeReplacements ($ route , $ replace );
90
92
$ data = $ this ->dataCleanUp ($ data );
91
93
@@ -97,6 +99,7 @@ protected function post(string $route, array $data = [], array $replace = [], st
97
99
*/
98
100
protected function patch (string $ route , array $ data = [], array $ replace = []): Response
99
101
{
102
+ $ data = array_merge ($ replace , $ data );
100
103
return $ this ->post ($ route , $ data , $ replace , __FUNCTION__ );
101
104
}
102
105
@@ -105,6 +108,7 @@ protected function patch(string $route, array $data = [], array $replace = []):
105
108
*/
106
109
protected function put (string $ route , array $ data = [], array $ replace = []): Response
107
110
{
111
+ $ data = array_merge ($ replace , $ data );
108
112
return $ this ->post ($ route , $ data , $ replace , __FUNCTION__ );
109
113
}
110
114
@@ -113,6 +117,7 @@ protected function put(string $route, array $data = [], array $replace = []): Re
113
117
*/
114
118
protected function delete (string $ route , $ data = [], array $ replace = []): Response
115
119
{
120
+ $ data = array_merge ($ replace , $ data );
116
121
return $ this ->post ($ route , $ data , $ replace , __FUNCTION__ );
117
122
}
118
123
}
0 commit comments