Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rajibbinalam/country-state-city
https://github.com/rajibbinalam/country-state-city
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rajibbinalam/country-state-city
- Owner: rajibbinalam
- License: mit
- Created: 2023-04-02T16:34:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-09T21:00:15.000Z (over 1 year ago)
- Last Synced: 2024-11-12T23:12:49.970Z (3 months ago)
- Language: PHP
- Size: 6.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Country State City
[![Latest Version on Packagist](https://img.shields.io/packagist/v/rajibbinalam/country-state-city.svg?style=flat-square)](https://packagist.org/packages/rajibbinalam/country-state-city)
[![Total Downloads](https://img.shields.io/packagist/dt/rajibbinalam/country-state-city.svg?style=flat-square)](https://packagist.org/packages/rajibbinalam/country-state-city)#### 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:
```bash
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```bash
php artisan vendor:publish
# Provider: rajib\LaravelCountryStateCity\CountryStateCityServiceProvider
```## Configuration The Migrations Table Name and Field
```php
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
```bash
php artisan migrate
```
## Database Seed
Register the Seeders file to your ```DatabaseSeeder.php``` and run the seed commands```php
$this->call([
CountryTableSeeder::class,
StateTableSeeder::class,
CityTableSeeder::class,
TimezoneTableSeeder::class,
]);
```
```bash
php artisan db:seed # it's need some time to seed the database
```## Contributing
We will accept your Contribution with respect.
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.## Credits
- [Rajib Bin Alam](https://github.com/rajibbinalam)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.