We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
The text was updated successfully, but these errors were encountered:
Ok, found a workaround.
Countries::all()->first(fn (Collection $item): bool => $item->alt_spellings->contains($country))
So we first take all countries and then filter.
Sorry, something went wrong.
Could you please close the issue?
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: