Skip to content

Commit

Permalink
Use order in sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Nov 13, 2024
1 parent 48798e1 commit e6dec98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Entries/EntryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public function updateOrders($collection, $ids = null)
$collection->queryEntries()
->when($ids, fn ($query) => $query->whereIn('id', $ids))
->get(['id'])
->each(function ($entry) {
$dispatch = UpdateCollectionEntryOrder::dispatch($entry->id(), $entry->order());
->each(function ($entry, $index) {
$dispatch = UpdateCollectionEntryOrder::dispatch($entry->id(), $index + 1);

$connection = config('statamic.eloquent-driver.collections.update_entry_order_connection', 'default');

Expand Down

0 comments on commit e6dec98

Please sign in to comment.