我尝试使用 Laravel 8 和 axios 在我的 MySQL 数据库中一次插入多行,但我收到此错误
这是我的 axios 电话
async insertar(history_records) {
try {
console.log(history_records)
const response = await axios
.post("/home/insert", history_records.results)
.then(response => {
console.log("worked")
// this.categories.push(this.categoryToAdd);
})
.catch(error => {
console.log(error);
});
} catch (error) {
this.request_status = error;
console.log(error);
}
},
这是存储功能 [![在此处输入图像描述][7]][7]
PD:很抱歉使用图像而不是代码,但我遇到了一些格式问题
public function store(Request $request)
{
error_log($request);
//Create item
foreach ($request as $history_record) {
$history = new Auroracoin();
$history->history_date = $history_record->date;
$history->rate = $history_record->rate;
}
$history->save();
return $history;
}



