Update (post): fix broken rss feed
This commit is contained in:
@@ -111,13 +111,13 @@ public function toFeedItem(): FeedItem
|
|||||||
'title' => $this->title,
|
'title' => $this->title,
|
||||||
'summary' => $this->excerpt,
|
'summary' => $this->excerpt,
|
||||||
'updated' => $this->updated_at,
|
'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,
|
'authorName' => optional($this->author)->name,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFeedItems()
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user