From 07f2f9bb3ec56bdbc4184609f68f88ff0f12be8d Mon Sep 17 00:00:00 2001 From: Charles Teh Date: Wed, 4 Oct 2023 22:36:28 +0800 Subject: [PATCH] Update (post): fix broken rss feed --- app/Models/Post.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/Post.php b/app/Models/Post.php index 23e88cb..f81c6bb 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -111,13 +111,13 @@ public function toFeedItem(): FeedItem 'title' => $this->title, 'summary' => $this->excerpt, 'updated' => $this->updated_at, - 'link' => route('posts.show', $this->slug), + 'link' => route('front.post', ['slug' => $this->slug, 'category_slug' => $this->category->slug]), 'authorName' => optional($this->author)->name, ]); } public static function getFeedItems() { - return self::where('status', 'published')->latest('published_at')->take(10)->get(); + return self::with('category')->where('status', 'publish')->latest('published_at')->take(20)->get(); } }