Country - State - City
Which is the best package to populate some dropdown in forms?
Squire doesn't have cities...
11 Replies
There is:
https://github.com/khsing/laravel-world
GitHub
GitHub - khsing/laravel-world: provide countries, states, and citie...
provide countries, states, and cities relations and database. - khsing/laravel-world
thanks, isn't heavy on the db?
Not really, it's DB but how often are you truly calling the country/state/city?
not very often
So it's not an issue, theres very little data in the grand schema of it.
i'm in trouble in implement world
in the country select i saw the name of the country but in the db code is saved instead of id
in the city field i saw the cities name in the select but when i save, in the db i have the id and in the frontend i saw the id and not the name
That is normal. You get the name by id then
ok but in the db i need to save country id and city id then in the select i need to see the name
anyone can help?
What with? You said you need to save the country id and the city id? What's the problem?
I would like to have the IDs in the database instead of the codes. Is it still okay if I save the codes? It is currently working. However, what I don't have is this: In an info list, I display the country like this:
But I don't have a Laravel-World function that returns the name of the province using the code saved in the database, something like this:
Do you know how php,laravel and databases work fully or are you just coming to it with filamentphp?
What you should do is on the model for where you implemented the world. Is to add a relationship for country and province, then when they render anywhere they render the name with :