-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
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
Lookup state by iso code? #2
Comments
After poking through the matching function it looks like in order to do this we need to overload the toArray method of the State class, can I submit a pull request? |
Hi! Have you tried $states->findOne(['isoCode' => $code])? Or directly from a country: $country->getStates()->findOne(...) |
Yeah, the problem I'm running into is that the toArray method needs to be overridden with the getters for each Member. Geographer::findOne(['code' => 'US'])->findOne(['isoCode' => 'TX']); The match method casts each object to an array before searching for key value pairs, which ends up limiting the search parameters \MenaraSolutions\Geographer\Divisible@toArray. |
I see that this has been fixed in master, can we get a release for Composer purposes? I need the magic getter from this commit: 0d64ea0 🙏 |
Sure, it's done. I didn't actually expect anybody to download this package before July ;-) I'm in the middle of preparing the first public release and a blog post with documentation |
I'm having trouble finding a way to lookup a state by iso code, is this possible?
The text was updated successfully, but these errors were encountered: