Update HashtagFollowerController, add getTags api method

This commit is contained in:
Daniel Supernault 2019-07-08 21:46:32 -06:00
parent 9805cd841f
commit 869360a744
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -47,4 +47,15 @@ class HashtagFollowController extends Controller
'state' => $state '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;
});
}
} }