Skip to content

Commit

Permalink
Add feature test cases for categories and tags API
Browse files Browse the repository at this point in the history
  • Loading branch information
zyml committed Sep 18, 2017
1 parent 835dca1 commit f11c988
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/Http/Controllers/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ public function topNTags($num = 5)
*/
protected function getSortedTags()
{
$tags = Tag::where('confession_tag', 'REGEXP', '#[a-z]+')->get()
$tags = Tag::query()
->where('confession_tag', 'REGEXP', '#[a-z]+')
->get()
->filter(function ($tag) {
return $tag->confessions()->approved()->count() > 0;
})
Expand Down

0 comments on commit f11c988

Please sign in to comment.