From 63c6aedb78d4935b28433aaa82319ff427a271bd Mon Sep 17 00:00:00 2001 From: Raphael Rott <78685408+rottifant@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:55:36 +0100 Subject: [PATCH] Fix confusing documentation for Media::setNewOrder method (#3759) --- docs/advanced-usage/ordering-media.md | 5 +++-- src/MediaCollections/Models/Concerns/IsSorted.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/advanced-usage/ordering-media.md b/docs/advanced-usage/ordering-media.md index 0902ed84f..e19a6c7d9 100644 --- a/docs/advanced-usage/ordering-media.md +++ b/docs/advanced-usage/ordering-media.md @@ -10,9 +10,10 @@ You can easily reorder a list of media by calling ̀€Media::setNewOrder`: ```php /** * This function reorders the records: the record with the first id in the array - * will get order 11, the record with the second id will get order 2, ... + * will get the starting order (defaults to 1), the record with the second id + * will get the starting order + 1, and so on. * - * A starting order number can be optionally supplied (defaults to 1). + * A starting order number can be optionally supplied. * * @param array $ids * @param int $startOrder diff --git a/src/MediaCollections/Models/Concerns/IsSorted.php b/src/MediaCollections/Models/Concerns/IsSorted.php index 8b0ea54e4..d127866bb 100644 --- a/src/MediaCollections/Models/Concerns/IsSorted.php +++ b/src/MediaCollections/Models/Concerns/IsSorted.php @@ -27,7 +27,8 @@ public function scopeOrdered(Builder $query): Builder /* * This function reorders the records: the record with the first id in the array - * will get order 1, the record with the second it will get order 2, ... + * will get the starting order (defaults to 1), the record with the second id + * will get the starting order + 1, and so on. * * A starting order number can be optionally supplied. */