We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bcc2d5d + cb1853a commit 60dfaf2Copy full SHA for 60dfaf2
src/Field/PostObject.php
@@ -26,7 +26,9 @@ public function process($fieldName)
26
$connection = $this->post->getConnectionName();
27
28
if (is_array($postId)) {
29
- $this->object = Post::on($connection)->whereIn('ID', $postId)->get();
+ $this->object = Post::on($connection)->whereIn('ID', $postId)->get()->sortBy(function ($item) use ($postId) {
30
+ return array_search($item->getKey(), $postId);
31
+ });
32
} else {
33
$this->object = Post::on($connection)->find($postId);
34
}
0 commit comments