rajibbinalam / country-state-city
find country state and cities all over the world
v0.2.0
2023-04-07 14:16 UTC
Requires
- php: ^8.1
- illuminate/contracts: ^10.0
- spatie/laravel-package-tools: ^1.14.0
Requires (Dev)
- laravel/pint: ^1.0
- nunomaduro/collision: ^7.9
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.0
- pestphp/pest-plugin-arch: ^2.0
- pestphp/pest-plugin-laravel: ^2.0
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2025-05-12 20:13:58 UTC
README
This Package is provid you world info about the country state and city name with their some local information
Installation
You can install the package via composer:
composer require rajibbinalam/country-state-city
Publish Vendor Files: Find the below files
- config > CountryStateCity.php
- database > migrations > country , state, city and timezone
- database > seeders > country , state, city and timezone
php artisan vendor:publish
# Provider: rajib\LaravelCountryStateCity\CountryStateCityServiceProvider
Configuration The Migrations Table Name and Field
return [ /* |-------------------------------------------------------------------- | Configaration Your Migrations. |---------------------------------------------------------------- | Set the table_name or use default LIKE: 'table_name' => 'countries', |---------------------------------------------------------------- | 'required' => true, will be added to the migration as a field |--------------------------------------------------------------------- */ 'migrations' => [ 'countries' => [ 'table_name' => 'countries', 'optional_fields' => [ 'phone_code' => [ 'required' => true, 'length' => 5, ], 'iso3' => [ 'required' => false, 'length' => 3, ], ], ], ], ];
Migrate
php artisan migrate
Database Seed
Register the Seeders file to your DatabaseSeeder.php
and run the seed commands
$this->call([ CountryTableSeeder::class, StateTableSeeder::class, CityTableSeeder::class, TimezoneTableSeeder::class, ]);
php artisan db:seed # it's need some time to seed the database
Contributing
We will accept your Contribution with respect. Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.