{"id":17180452,"url":"https://github.com/agoalofalife/geography","last_synced_at":"2025-04-13T17:12:38.344Z","repository":{"id":56942116,"uuid":"87818271","full_name":"agoalofalife/geography","owner":"agoalofalife","description":"Building a hierarchy of regions","archived":false,"fork":false,"pushed_at":"2021-02-05T11:45:33.000Z","size":72,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T08:03:33.467Z","etag":null,"topics":["cities","country","geography","php-geography","regions"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agoalofalife.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-10T14:07:32.000Z","updated_at":"2021-03-24T12:46:11.000Z","dependencies_parsed_at":"2022-08-21T07:50:32.240Z","dependency_job_id":null,"html_url":"https://github.com/agoalofalife/geography","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Fgeography","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Fgeography/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Fgeography/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agoalofalife%2Fgeography/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agoalofalife","download_url":"https://codeload.github.com/agoalofalife/geography/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750127,"owners_count":21155687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cities","country","geography","php-geography","regions"],"created_at":"2024-10-15T00:29:38.799Z","updated_at":"2025-04-13T17:12:38.325Z","avatar_url":"https://github.com/agoalofalife.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[EN](https://github.com/agoalofalife/geography/blob/master/README.md) | [RU](https://github.com/agoalofalife/geography/blob/master/README_RU.md)\n\n**The geography of the regions**\n\n[![Build Status](https://travis-ci.org/agoalofalife/geography.svg?branch=master)](https://travis-ci.org/agoalofalife/geography)  [![License](https://poser.pugx.org/agoalofalife/geography/license)](https://packagist.org/packages/agoalofalife/geography)  [![Twitter](https://img.shields.io/twitter/url/https/github.com/agoalofalife/geography.svg?style=social\u0026style=plastic)](https://twitter.com/intent/tweet?text=Wow:\u0026url=%5Bobject%20Object%5D)  [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/agoalofalife/geography/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/agoalofalife/geography/?branch=master) [![Build Status](https://scrutinizer-ci.com/g/agoalofalife/geography/badges/build.png?b=master)](https://scrutinizer-ci.com/g/agoalofalife/geography/build-status/master)\n\n**What is it?**\n\nThis package solves the problem with the hierarchy of countries, regions, settlements in your database.\nA few commands in the console, you deploy all the necessary the country , regardless of country and language.\n\n**The installation of the package**\n\nFor installation, you must run the command from composer\n\n    \n    composer require agoalofalife/geography\n\n    \n**Data migration**\n\nRun the command :\n\n   ``` \n   vendor/bin/geography install\n   ```\n    \nFollowing the instructions step by step, continue to enter information.\n\n 1. Database selection\n \n```\n======================================\nPlease choose your database type :\n  [ 0 ] mysql\n  [ 1 ] postgres\n```\n\n 2. Choice your host\n \n ```\nEnter host for database , please : localhost\n```\n\n 2. The name of the database:\n ```\n Enter database name,  please : test\n ```\n  3. The user in the database:\n ```\n Enter database username,  please : root\n```\n 4. The password in the database (not shown):\n ```\n Enter database password,  please : \n```\n 5. To select the language:\n```\nPlease select your native language :\n  [0] ru\n  [1] en\n  [2] ua\n  [3] be\n  [4] es\n  [5] fi\n  [6] de\n  [7] it\n \u003e \n```\n 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**\n\n ```\nthe list of countries you can see here 3166-1 alpha-2\nyou can specify multiple countries separated by commas\nexample EN, RU\nEnter  the country you wish to migrate,  please : \n```\nAfter some time, depending on the volume of information you will see in my database three tables : \n - Country\n - Regions\n - Сities\n \n```\n You have just selected: AU,BR \n 3/3 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%\n```\nCongratulations to all successful!\n\n**Integration with Laravel**\n\nSince the environment Laravel uses for its tables Seeder and Migration, we can freely copy it to your project Laravel!\n  \n ```\n vendor/bin/geography migrate:laravel  \n ```\n After you get your files in a folder database and config.\n \nTo configure your language and countries you want to migrate, you must change the configuration file in config/geography.php :\n\n ```\n return [\n     //     Your native language\n     //     0 — Russian,\n     //     1 — Ukrainian,\n     //     2 — Belarusian,\n     //     3 — English,\n     //     4 — Spanish,\n     //     5 — Finnish,\n     //     6 — German,\n     //     7 — Italian.\n     'locale'   =\u003e 0,\n\n     // Country you wish to migrate\n     // standard 3166-1 alpha-2\n     // example RU,AU\n    'country'  =\u003e 'RU',\n    \n     'nameTable' =\u003e [\n         'country' =\u003e 'country',\n         'regions' =\u003e 'regions',\n         'cities'  =\u003e 'cities'\n     ],\n     'access_token' =\u003e ''\n];\n ```\nNext, you need to perform :\n\n ```\n composer dump\n php artisan migrate\n \n php artisan db:seed\n или для seeder :\n php artisan db:seed --class=CountryTableSeeder\n php artisan db:seed --class=RegionsTableSeeder\n php artisan db:seed --class=CitiesTableSeeder\n ```\n \nAfter you can easily remove the package and what not to worry!\n\n\n[![yes](https://media.giphy.com/media/2RGhmKXcl0ViM/giphy.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoalofalife%2Fgeography","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagoalofalife%2Fgeography","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagoalofalife%2Fgeography/lists"}