Ensure posts are sorted correctly

This commit is contained in:
Toby Zerner 2015-08-17 15:52:39 +09:30
parent 2b812ab211
commit a32250884c

View File

@ -89,7 +89,7 @@ class PostRepository
$posts = Post::with('discussion')->whereIn('id', $visibleIds)->get();
$posts->sort(function ($a, $b) use ($ids) {
$posts = $posts->sort(function ($a, $b) use ($ids) {
$aPos = array_search($a->id, $ids);
$bPos = array_search($b->id, $ids);