Skip to content

Commit

Permalink
Implemented requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
spitfire305 committed Jan 4, 2024
1 parent 142a749 commit a2860f0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Services/BulkService.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function editing(array $fields, Bulk $bulk): int
return $this->updateRelations($filledFields, $mirrorOptions);
}

$parent = Str::singular($model->getTable()) . '_id';
$parent = method_exists($model, 'getParentKeyName') ? $model->getParentKeyName() : null;

// Todo: move model fetch above to actually use with()
foreach ($this->ids as $id) {
Expand All @@ -308,7 +308,7 @@ public function editing(array $fields, Bulk $bulk): int
}
$entityFields = $filledFields;

if(isset($entityFields[$parent]) && $entityFields[$parent] == strval($entity->id)) {
if(isset($entityFields[$parent]) && intval($entityFields[$parent]) == $entity->id) {
unset($entityFields[$parent]);
}

Expand Down

0 comments on commit a2860f0

Please sign in to comment.