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
1 changed files with 11 additions and 0 deletions

View File

@ -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;
});
}
}