Update (post): fix broken rss feed

This commit is contained in:
2023-10-04 22:36:28 +08:00
parent 8c77682764
commit 07f2f9bb3e

View File

@@ -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();
}
}