Updated skip logic if plant not found

This commit is contained in:
dhanabalan
2025-04-28 00:14:18 +05:30
parent 38c37c74ed
commit c8e2a9c7b9
2 changed files with 6 additions and 0 deletions

View File

@@ -46,6 +46,9 @@ class ItemImporter extends Importer
public function resolveRecord(): ?Item
{
$plant = \App\Models\Plant::where('name', $this->data['plant'])->first();
if (!$plant) {
return null;
}
return Item::updateOrCreate([
'code' => $this->data['code'],
'plant_id' => $plant->id