2017 © Pedro PelΓ‘ez
 

library geography

image

agoalofalife/geography

  • Saturday, April 28, 2018
  • by agoalofalife
  • Repository
  • 1 Watchers
  • 1 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

EN | RU, (*1)

The geography of the regions, (*2)

Build Status License Twitter Scrutinizer Code Quality Build Status, (*3)

What is it?, (*4)

This package solves the problem with the hierarchy of countries, regions, settlements in your database. A few commands in the console, you deploy all the necessary the country , regardless of country and language., (*5)

The installation of the package, (*6)

For installation, you must run the command from composer, (*7)

composer require agoalofalife/geography

Data migration, (*8)

Run the command :, (*9)

vendor/bin/geography install, (*10)

Following the instructions step by step, continue to enter information., (*11)

  1. Database selection
======================================
Please choose your database type :
  [ 0 ] mysql
  [ 1 ] postgres
  1. Choice your host, (*12)

    ``` Enter host for database , please : localhost, (*13)


2. The name of the database: ``` Enter database name, please : test ``` 3. The user in the database: ``` Enter database username, please : root
  1. The password in the database (not shown): ``` Enter database password, please :
 5. To select the language:

Please select your native language : [0] ru [1] en [2] ua [3] be [4] es [5] fi [6] de [7] it, (*14)

 5. Choose the country you want to migrate, for example I need a few countries (Australia and Brazil), respectively, I would need to enter : **AU,BR**

 ```
the list of countries you can see here 3166-1 alpha-2
you can specify multiple countries separated by commas
example EN, RU
Enter  the country you wish to migrate,  please : 

After some time, depending on the volume of information you will see in my database three tables : - Country - Regions - Π‘ities, (*15)

 You have just selected: AU,BR 
 3/3 [β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“β–“] 100%

Congratulations to all successful!, (*16)

Integration with Laravel, (*17)

Since the environment Laravel uses for its tables Seeder and Migration, we can freely copy it to your project Laravel!, (*18)

vendor/bin/geography migrate:laravel After you get your files in a folder database and config., (*19)

To configure your language and countries you want to migrate, you must change the configuration file in config/geography.php :, (*20)

``` return [ // Your native language // 0 β€” Russian, // 1 β€” Ukrainian, // 2 β€” Belarusian, // 3 β€” English, // 4 β€” Spanish, // 5 β€” Finnish, // 6 β€” German, // 7 β€” Italian. 'locale' => 0,, (*21)

 // Country you wish to migrate
 // standard 3166-1 alpha-2
 // example RU,AU
'country'  => 'RU',

 'nameTable' => [
     'country' => 'country',
     'regions' => 'regions',
     'cities'  => 'cities'
 ],
 'access_token' => ''

]; ``` Next, you need to perform :, (*22)

``` composer dump php artisan migrate, (*23)

php artisan db:seed или для seeder : php artisan db:seed --class=CountryTableSeeder php artisan db:seed --class=RegionsTableSeeder php artisan db:seed --class=CitiesTableSeeder ```, (*24)

After you can easily remove the package and what not to worry!, (*25)

[yes, (*26)

The Versions

28/04 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar agoalofalife

city geography regions

28/04 2018

v0.1.1

0.1.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar agoalofalife

city geography regions

14/04 2017

v0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar agoalofalife

city geography regions