Updated skip logic if plant not found
This commit is contained in:
@@ -34,6 +34,9 @@ class BlockImporter extends Importer
|
|||||||
public function resolveRecord(): ?Block
|
public function resolveRecord(): ?Block
|
||||||
{
|
{
|
||||||
$plant = \App\Models\Plant::where('name', $this->data['plant'])->first();
|
$plant = \App\Models\Plant::where('name', $this->data['plant'])->first();
|
||||||
|
if (!$plant) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return Block::updateOrCreate([
|
return Block::updateOrCreate([
|
||||||
'name' => $this->data['name'],
|
'name' => $this->data['name'],
|
||||||
'plant_id' => $plant->id
|
'plant_id' => $plant->id
|
||||||
|
|||||||
Reference in New Issue
Block a user