Heim > Fragen und Antworten > Hauptteil
foreach ($request->repair_report as $key => $value) {
Perbaikan_laporan::create([ "jadwal_sidang_id" => $request->input("jadwal_sidang_id"), "mahasiswa_id" => $request->input("mahasiswa_id"), "dosen_id" => $request->input("dosen_id"), "perbaikan_laporan" => $request->input("perbaikan_laporan")[$key], ]); }
P粉1067157032023-12-15 09:11:23
首先,您可以按如下方式调用请求数据,问题是您首先将输入定义为字符串,但是当它已经转换为字符串时您想使用它来获取密钥。
Perbaikan_laporan::create([ "jadwal_sidang_id" => $request->jadwal_sidang_id, "mahasiswa_id" => $request->mahasiswa_id, "dosen_id" => $request->dosen_id, "perbaikan_laporan" => $request->perbaikan_laporan[$key], ]);