mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 16:23:16 +00:00
Update DiscoverController
This commit is contained in:
parent
4a7a56f2cb
commit
a616bd66f6
1 changed files with 5 additions and 1 deletions
|
@ -36,13 +36,17 @@ class DiscoverController extends Controller
|
|||
->firstOrFail();
|
||||
|
||||
$posts = $tag->posts()
|
||||
->whereHas('media')
|
||||
->withCount(['likes', 'comments'])
|
||||
->whereIsNsfw(false)
|
||||
->whereVisibility('public')
|
||||
->has('media')
|
||||
->orderBy('id', 'desc')
|
||||
->simplePaginate(12);
|
||||
|
||||
if($posts->count() == 0) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return view('discover.tags.show', compact('tag', 'posts'));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue