I am using eloquent model and there is json request which contains array and i am prossessing it using foreach like folloeing:
public function save(Request $request){
$i = 0;
$flag = 1;
foreach ($request->all() as $record) {
if($flag){
$flag = 0;
continue;
}
else{
$user = \App\barcodedb::create($record);
}
}
}
is it the correct way to save the record from array?