mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-30 02:03: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();
|
->firstOrFail();
|
||||||
|
|
||||||
$posts = $tag->posts()
|
$posts = $tag->posts()
|
||||||
|
->whereHas('media')
|
||||||
->withCount(['likes', 'comments'])
|
->withCount(['likes', 'comments'])
|
||||||
->whereIsNsfw(false)
|
->whereIsNsfw(false)
|
||||||
->whereVisibility('public')
|
->whereVisibility('public')
|
||||||
->has('media')
|
|
||||||
->orderBy('id', 'desc')
|
->orderBy('id', 'desc')
|
||||||
->simplePaginate(12);
|
->simplePaginate(12);
|
||||||
|
|
||||||
|
if($posts->count() == 0) {
|
||||||
|
abort(404);
|
||||||
|
}
|
||||||
|
|
||||||
return view('discover.tags.show', compact('tag', 'posts'));
|
return view('discover.tags.show', compact('tag', 'posts'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue