How to use the extension of Laravel World
This article introduces the knowledge of "how to use the extension of Laravel World". In the operation of practical cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Laravel World-country and city data with its own database (Chinese supported)
Laravel World (https://github.com/nnjeim/world) is a package that provides a list of countries, states, cities, currencies, and time zones. World integrates data with the Eloquent model through a database and provides Facades, helper, and API routing:
Use Nnjeim\ World\ World;$action = World::countries () / * {"success": true, "message": "countries", "data": [{"id": 1, "name": "Afghanistan"}, {"id": 2, "name": "land Islands"},...],} * /
This is another example in readme, which uses a filter to get the country and cities within that country:
/ / get country and city $action = World::countries (['fields' = >' states,cities', 'filters' = > [' iso2' = > 'FR',]]) / * {"success": true, "message": "countries", "data": ["id": 77, "name": "France", "states": [{"id": 1271, "name": "Alo"}, {"id": 1272 "name": "Alsace"},], "cities": [{"id": 25148, "name": "Abondance"}, {"id": 25149, "name": "Abrest"} []],} * / "how to use Laravel World extensions" ends here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!