When we try to find a country by alternative names using sth like this:
(new Countries())->first(fn ($item): bool => \in_array($country, $item->alt_spellings, true))
We always get an error:
Exception : Serialization of 'Closure' is not allowed
It doesn't matter we use first() or filter(). Any option to use a function is not possible.
When we try to find a country by alternative names using sth like this:
(new Countries())->first(fn ($item): bool => \in_array($country, $item->alt_spellings, true))We always get an error:
Exception : Serialization of 'Closure' is not allowedIt doesn't matter we use first() or filter(). Any option to use a function is not possible.