diff --git a/src/Traits/Sequenceable.php b/src/Traits/Sequenceable.php index 9376bf8..9ec1646 100644 --- a/src/Traits/Sequenceable.php +++ b/src/Traits/Sequenceable.php @@ -7,7 +7,6 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Collection; -use Illuminate\Support\Facades\DB; trait Sequenceable { @@ -235,7 +234,7 @@ protected function getOriginalSequenceValue(): ?int */ protected static function updateSequenceablesAffectedBy(Model $model): void { - DB::transaction(function () use ($model) { + $model->getConnection()->transaction(function () use ($model) { $modelsToUpdate = $model->getSequence() ->where('id', '!=', $model->id) ->filter(function ($sequenceModel) use ($model) {