laravel-road / ibge-locations
Laravel 客户端用于消费 IBGE Locations API
v0.2.1
2021-01-11 21:13 UTC
Requires
- guzzlehttp/guzzle: ^7.2
- illuminate/http: ^8.21
- illuminate/support: ^8.0
Requires (Dev)
- orchestra/testbench: ^6.7
- phpunit/phpunit: ^9.5
README
安装
composer require laravel-road/ibge-locations php artisan ibge-locations:install // optional, but necessary to use the db driver
如何使用
$states = Locations::getStates(); $cities = Locations::getStates($states->first()->initials);
支持的驱动程序
- api(默认)
- db
环境
- IBGE_LOCATIONS_DRIVER=api
- IBGE_LOCATIONS_BASEURL=https://servicodados.ibge.gov.br/api/v1/localidades
- IBGE_LOCATIONS_STATES_ORDERBY=name