diff --git a/app/Http/Controllers/DiscoverController.php b/app/Http/Controllers/DiscoverController.php index ae262c6d3..41efc18a5 100644 --- a/app/Http/Controllers/DiscoverController.php +++ b/app/Http/Controllers/DiscoverController.php @@ -129,10 +129,16 @@ class DiscoverController extends Controller $tag = $request->input('hashtag'); $hashtag = Hashtag::whereName($tag)->firstOrFail(); - $res['tags'] = StatusHashtagService::get($hashtag->id, $page, $end); if($page == 1) { - $res['follows'] = HashtagFollow::whereUserId(Auth::id())->whereHashtagId($hashtag->id)->exists(); + $res['follows'] = HashtagFollow::whereUserId(Auth::id()) + ->whereHashtagId($hashtag->id) + ->exists(); } + $res['hashtag'] = [ + 'name' => $hashtag->name, + 'url' => $hashtag->url() + ]; + $res['tags'] = StatusHashtagService::get($hashtag->id, $page, $end); return $res; }