From 371edb7ba6a337ab74b79d13c71634693cf03b83 Mon Sep 17 00:00:00 2001 From: James Collins Date: Wed, 25 Jan 2023 12:43:09 +1000 Subject: [PATCH] add default sorting --- app/Filters/PostFilter.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Filters/PostFilter.php b/app/Filters/PostFilter.php index 5c78f14..030b5c5 100644 --- a/app/Filters/PostFilter.php +++ b/app/Filters/PostFilter.php @@ -14,6 +14,13 @@ class PostFilter extends FilterAbstract */ protected $class = '\App\Models\Post'; + /** + * Default column sorting (prefix with - for descending) + * + * @var string|array + */ + protected $defaultSort = '-publish_at'; + /** * Determine if the user can view the media model