diff --git a/app/Http/Controllers/HashtagFollowController.php b/app/Http/Controllers/HashtagFollowController.php index be47a9289..585248abb 100644 --- a/app/Http/Controllers/HashtagFollowController.php +++ b/app/Http/Controllers/HashtagFollowController.php @@ -47,4 +47,15 @@ class HashtagFollowController extends Controller 'state' => $state ]; } + + public function getTags(Request $request) + { + return HashtagFollow::with('hashtag')->whereUserId(Auth::id()) + ->inRandomOrder() + ->take(3) + ->get() + ->map(function($follow, $k) { + return $follow->hashtag->name; + }); + } }