回答編集履歴
2
修正
answer
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
CakePHPとかと書き方混同してると思います。(たぶん)
|
2
2
|
|
3
|
+
does not existは「使えない」ではなく「存在しない」です。
|
4
|
+
|
3
5
|
`return $this->response($responseBody);`
|
4
6
|
|
5
7
|
ここ「$this」なので「自身またはその親クラス」を見に行ってますが、
|
6
8
|
[response](https://readouble.com/laravel/6.x/ja/responses.html)はそもそも[Illuminate/Http/Response](https://github.com/laravel/framework/blob/6.x/src/Illuminate/Http/Response.php)のインスタンスであってメソッドではないです。
|
7
|
-
[Controller](https://github.com/laravel/laravel/blob/master/app/Http/Controllers/Controller.php)をたどっていってもresponseという
|
9
|
+
[Controller](https://github.com/laravel/laravel/blob/master/app/Http/Controllers/Controller.php)をたどっていってもresponseというメソッドはないのではないでしょうか。
|
8
10
|
|
9
|
-
単
|
11
|
+
単に`$responseBody`をreturnするだけではできませんか?
|
1
修正
answer
CHANGED
@@ -4,4 +4,6 @@
|
|
4
4
|
|
5
5
|
ここ「$this」なので「自身またはその親クラス」を見に行ってますが、
|
6
6
|
[response](https://readouble.com/laravel/6.x/ja/responses.html)はそもそも[Illuminate/Http/Response](https://github.com/laravel/framework/blob/6.x/src/Illuminate/Http/Response.php)のインスタンスであってメソッドではないです。
|
7
|
+
[Controller](https://github.com/laravel/laravel/blob/master/app/Http/Controllers/Controller.php)をたどっていってもresponseというプロパティにResponseをセットしているところはおそらくないのではないでしょうか。
|
8
|
+
|
7
9
|
単純に`return $response($responseBody);`で良いのでは?
|