Laravel Location ▲
This Package offers a simple way to get Countries, Cities and States that you may need for your Application, most especially for dropdown menus.
Require the package via composer into your project
composer require ichtrojan/laravel-location
Next, publish the Seeders from the package
php artisan vendor:publish --tag=laravel-location-seeds
php artisan vendor:publish
You will end up with a selection like this
input the number that matches with
Ichtrojan\Location\LocationServiceProvider and press enter.
before you do this make sure your correct Database credentials are set in the
php artisan migrate
Finally, run the Package seeders
php artisan db:seed --class=LocationDatabaseSeeder
||return all countries|
||return a single country by its ID|
||return all states|
||return a single state by its ID|
||return all states in a country using the country ID|
||return all cities|
||return a single city by its ID|
||return all cities in a state using the state ID|
Free for all, if you find an issue with the package or if a group of people somehow created a new country please send in a PR.