質問編集履歴

2

ソースコードの修正

2021/04/17 05:27

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -26,6 +26,8 @@
26
26
 
27
27
  ### 該当のソースコード
28
28
 
29
+ index.vue
30
+
29
31
  <template>
30
32
 
31
33
  <body>
@@ -142,6 +144,36 @@
142
144
 
143
145
 
144
146
 
147
+ PostController.php
148
+
149
+
150
+
151
+ 62. public function search(Request $request)
152
+
153
+ 63.{
154
+
155
+
156
+
157
+ 64. $category = Category::where('name',$request->name)->first();
158
+
159
+
160
+
161
+ 65. $posts=Post::where('category_id',$category[id])->get();
162
+
163
+
164
+
165
+ 66. $param = ['input'=>$request->name,'posts'=>$posts];
166
+
167
+
168
+
169
+ 67.return response()->json(['input'=>$param],200);
170
+
171
+
172
+
173
+  }
174
+
175
+
176
+
145
177
  ```ここに言語名を入力
146
178
 
147
179
  Nuxt.js
@@ -150,29 +182,7 @@
150
182
 
151
183
  ```
152
184
 
153
- 62. public function search(Request $request)
185
+
154
-
155
- 63.{
156
-
157
-
158
-
159
- 64. $category = Category::where('name',$request->name)->first();
160
-
161
-
162
-
163
- 65. $posts=Post::where('category_id',$category[id])->get();
164
-
165
-
166
-
167
- 66. $param = ['input'=>$request->name,'posts'=>$posts];
168
-
169
-
170
-
171
- 67.return response()->json(['input'=>$param],200);
172
-
173
-
174
-
175
-  }
176
186
 
177
187
  ### 試したこと
178
188
 

1

ソースコードに番号振りました

2021/04/17 05:27

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -150,29 +150,29 @@
150
150
 
151
151
  ```
152
152
 
153
- public function search(Request $request)
153
+ 62. public function search(Request $request)
154
154
 
155
- {
155
+ 63.{
156
156
 
157
157
 
158
158
 
159
- $category = Category::where('name',$request->name)->first();
159
+ 64. $category = Category::where('name',$request->name)->first();
160
160
 
161
161
 
162
162
 
163
- $posts=Post::where('category_id',$category[id])->get();
163
+ 65. $posts=Post::where('category_id',$category[id])->get();
164
164
 
165
165
 
166
166
 
167
- $param = ['input'=>$request->name,'posts'=>$posts];
167
+ 66. $param = ['input'=>$request->name,'posts'=>$posts];
168
168
 
169
169
 
170
170
 
171
- return response()->json(['input'=>$param],200);
171
+ 67.return response()->json(['input'=>$param],200);
172
172
 
173
173
 
174
174
 
175
- }
175
+  }
176
176
 
177
177
  ### 試したこと
178
178