filterBy() in route

I want to filter a page collection inside a route. My code:

[
'pattern' => 'categories/(:alpha)/filter',
'action' => function($category) {
  $items = page('items')->children()->listed()->filterBy('category', $category);
]

page('items')->children()->listed() returns the pages I want, but the filtering by the ‘category’ field is not happening. How can I solve this?

Possibly: filterBy('category', $category, ',')

I found the problem, the ‘category’ field in the content files and $category are in different languages. Sorry!