Skip to content

Commit

Permalink
fix: prevent endless loop on incrementOrDecrement in laravel 8 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
riesjart authored Nov 9, 2020
1 parent 32b9c60 commit e918f80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Traits/Sequenceable.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ protected static function updateSequenceablesAffectedBy(Model $model): void
->where('id', '!=', $model->id)
->filter(function ($sequenceModel) use ($model) {
return $sequenceModel->isAffectedByRepositioningOf($model);
});
})
->each->withoutSequencing();

if ($model->isMovingUpInSequence()) {
static::decrementSequenceValues($modelsToUpdate);
Expand Down

0 comments on commit e918f80

Please sign in to comment.