3
即時得到這個錯誤,當我嘗試這樣做:
$additional_features = $request->input('additional_features');
foreach($additional_features as $additional_feature){
$data = [
'name' => $additional_feature
];
$additional = new Feature::firstOrCreate($data);
}
$ additional_features是一個數組,我嘗試添加那麼,我有多少物品,我會有那麼多的記錄。任何建議?