Closed terdia closed 6 years ago
discussions.order
is how the list of discussions will be ordered while posts.order
is how the individual posts inside a discussion are ordered.
@marktopper I understand that but it doesn't work because in the source code you only order by discussions (twice)
I notice that when I set order by posts to descending order it had no effect my config 'order_by' => [ 'posts' => [ 'order' => 'created_at', 'by' => 'DESC' ], 'discussions' => [ 'order' => 'last_reply_at', 'by' => 'DESC' ] ],
Then I did a little digging and found a bug in ChatterController.php $discussions = Models::discussion()->with('user')->with('post')->with('postsCount')->with('category')->orderBy(config('chatter.order_by.discussions.order'), config('chatter.order_by.discussions.by'));
using order by config('chatter.order_by.discussions.order') twice I have created a pull request with the fix https://github.com/thedevdojo/chatter/pull/202