Skip to content
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

The Example Code snippets don’t work #41

Open
ronlinet opened this issue Dec 2, 2022 · 3 comments
Open

The Example Code snippets don’t work #41

ronlinet opened this issue Dec 2, 2022 · 3 comments

Comments

@ronlinet
Copy link

ronlinet commented Dec 2, 2022

I have tried to get children of Great Britain and I get unfiltered rows of all DB.

        $geo = geo::getCountry('gb')->children()->orderby('name')->get();
        foreach ($geo as $g) echo $g->name . "<br>";

Output


Adamaoua Region
Adazu Novads
Agadez
Aizkraukles novads
Al Bahah Region
Al Bayda Governorate
Al Jawf Region
Al-Qassim Region
Alagoas
Alaska
Alibori
...............

@ronlinet
Copy link
Author

ronlinet commented Dec 2, 2022

The issue is already brought up here but the ticket has been closed without any explicit fix.

@ronlinet
Copy link
Author

ronlinet commented Dec 2, 2022

The same with demo route in fact that children method doesn't work.

@ronlinet
Copy link
Author

ronlinet commented Dec 3, 2022

So I managed to get it to work with Eloquent.

States 
Geo::country( $request->country )->where(['level' =>  'ADM1'])->orderBy('name')->get(); 
Counties
Geo::country( $request->country )->where(['level' =>  'ADM2'])->orderBy('name')->get(); 
Cities
Geo::country( $request->country )->where(['level' =>  'ADM3'])->orderBy('name')->get();

I will leave it up to the maintainer to decide if the ticket should stay open. Personally I think there are fixes to be implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant