diff --git a/config/eloquent-driver.php b/config/eloquent-driver.php index 59de9c1d..20fb3de3 100644 --- a/config/eloquent-driver.php +++ b/config/eloquent-driver.php @@ -26,6 +26,7 @@ 'driver' => 'eloquent', 'model' => \Statamic\Eloquent\Collections\CollectionModel::class, 'update_entry_order_queue' => 'default', + 'update_entry_order_connection' => 'default', ], 'collection_trees' => [ diff --git a/src/Collections/CollectionRepository.php b/src/Collections/CollectionRepository.php index 88f5ee48..e5d53bc4 100644 --- a/src/Collections/CollectionRepository.php +++ b/src/Collections/CollectionRepository.php @@ -85,8 +85,15 @@ public function updateEntryOrder(CollectionContract $collection, $ids = null) $collection->queryEntries() ->get(['id']) ->each(function ($entry) { - UpdateCollectionEntryOrder::dispatch($entry->id()) - ->onQueue(config('statamic.eloquent-driver.collections.update_entry_order_queue', 'default')); + $dispatch = UpdateCollectionEntryOrder::dispatch($entry->id()); + + $connection = config('statamic.eloquent-driver.collections.update_entry_order_connection', 'default'); + + if ($connection != 'default') { + $dispatch->onConnection($connection); + } + + $dispatch->onQueue(config('statamic.eloquent-driver.collections.update_entry_order_queue', 'default')); }); } }