Updated skip logic if plant not found

This commit is contained in:
dhanabalan
2025-04-28 00:12:29 +05:30
parent e328569cc1
commit 38c37c74ed

View File

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