teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

修正

2020/04/21 02:54

投稿

m.ts10806
m.ts10806

スコア80888

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というプロパティにResponseをセトしているところおそらくないのではないでしょうか。
9
+ [Controller](https://github.com/laravel/laravel/blob/master/app/Http/Controllers/Controller.php)をたどっていってもresponseというメソはないのではないでしょうか。
8
10
 
9
- に`return $response($responseBody);`で良いのでは?
11
+ 単に`$responseBody`をreturnするだけではできませんか

1

修正

2020/04/21 02:54

投稿

m.ts10806
m.ts10806

スコア80888

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);`で良いのでは?