質問編集履歴

1

コードの挿入部分に入っていないコードがあったので修正しました

2022/03/10 14:07

投稿

ttpk
ttpk

スコア338

test CHANGED
File without changes
test CHANGED
@@ -115,7 +115,7 @@
115
115
 
116
116
 
117
117
  **controllerのコード**
118
- ``'PHP
118
+ ```PHP
119
119
  namespace App\Http\Controllers;
120
120
 
121
121
  use Illuminate\Http\Request;
@@ -138,13 +138,12 @@
138
138
 
139
139
  Auth::user()->drills()->save($drill->fill($request->all()));
140
140
  $drill = Auth::user()->drills()->create(['name' => $request->input['title']]);
141
-    $drill->problems()->saveMany([
141
+ $drill->problems()->saveMany([
142
142
  new App\Problem(['problem0' => $request->problem0 ]),
143
143
  new App\Problem(['problem1' => $request->problem1 ]),
144
- ・・・
144
+ 以下problem9まで続く
145
145
  ]);
146
- }
146
+ }
147
- }
148
147
  ```
149
148
  $drillのデータの取得方法に間違いはないでしょうか?
150
149
  problemsテーブルにsaveManyメソッドを使ってデータを保存しようとしていますが