This commit is contained in:
2024-08-21 13:44:24 +07:00
parent ff05c31914
commit e4d54ab78c
2 changed files with 36 additions and 1 deletions

View File

@@ -152,6 +152,7 @@ class DrugController extends Controller
$importedRows = 0;
$failedRows = [];
foreach ($processedData as $row) {
try {
Drug::updateOrCreate([
@@ -169,11 +170,13 @@ class DrugController extends Controller
'type' => $row['type'],
'dosage' => $row['dosage'],
'remark' => $row['remark'],
'price' => $row['price'],
// 'price' => $row['price'],
'unit' => $row['unit'],
]
);
$importedRows++;
} catch (\Exception $e) {
dd($e);
$failedRows[] = $row;
}
}