Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function recent(Request $request, ArticleType $articleType): ArticleCollection
- {
- $request->validate([
- 'articleType' => 'string|in:posts,tips-&-tutorials'
- ]);
- return new ArticleCollection(Article::with(['author', 'status', 'banner'])
- ->published()
- ->whereBelongsTo($articleType)
- ->latest()
- ->cursorPaginate(10));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement