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