Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change seeders implementation, fix Russia relationship with its cities and add all Morocco' cities. #14

Merged
merged 2 commits into from
Feb 8, 2019

Conversation

mednasserallah
Copy link
Contributor

Change array() function to short array syntax ([]) in the following seeders for less code and to make things easy to maintenance.

  • database/seeds/WorldCitiesTableSeeder.php
  • database/seeds/WorldContinentsTableSeeder.php
  • database/seeds/WorldCountriesTableSeeder.php

Also, I grouped cities by their countries, and countries by the continents.
Make more sense in case someone wants to search for certain country to add some missing cities instead of check the country ID and then search by ID.

Fix Russia (country) relationship with its cities

>>> use Khsing\World\World;
>>> World::getByCode('ru')->cities->pluck('name')
=> Illuminate\Support\Collection {#3072
     all: [ 
        "Abakan", "Aginskoye", "Anadyr", "Arkhangelsk", "Astrakhan", "Barnaul", "Belgorod", "Birobidzan", 
        "Blagoveshchensk", "Bryansk", "Chabarovsk", "Cheboksary", "Chelyabinsk", "Cherkessk", "Chita", 
        "Elista", "Gorno-Altajsk", "Grozny", "Irkutsk", "Ivanovo", "Izhevsk", "Jakutsk", "Jaroslavl", 
        "Jekaterinburg", "Juzno-Sachalinsk", "Kaliningrad", "Kaluga", "Kazan", "Kemerovo", "Khanty-Mansiysk", 
        "Kirov", "Kostroma", "Krasnodar", "Krasnojarsk", "Kudymkar", "Kurgan", "Kursk", "Kyzyl", "Lipeck", "Magadan", 
        "Magas", "Makhachkala", "Maykop", "Moscow", "Murmansk", "Nalchik", "Naryan-Mar", "Niznij Novgorod", 
        "Novosibirsk", "Omsk", "Orel", "Orenburg", "Palana", "Penza", "Perm", "Petropavlovsk-Kamchatskiy", "Petrozavodsk", 
        "Pskov", "Rostov-na-Donu", "Ryazan", "Salekhard", "Samara", "Saransk", "Saratov", "Smolensk", "St. Peterburg", 
        "Stavropol", "Syktyvkar", "Tambov", "Tomsk", "Tula", "Tver", "Tyumen", "Ufa", "Ulan-Ude", "Uljanovsk", "Ust-Ordynsky", 
        "Velikij Novgorod", "Vladikavkaz", "Vladimir", "Vladivostok", "Volgograd", "Vologda", "Voronezh", "Yoshkar-Ola",
     ],
   }

Add all Morocco' cities

>>> use Khsing\World\World;
>>> World::getByCode('ma')->cities->pluck('name');
=> Illuminate\Support\Collection {#3045
     all: [ 
        "Agadir", "Aït Melloul", "Al Hoceima", "Azrou", "Beni Mellal", "Benslimane", "Berkane", "Berrechid", "Bouskoura", 
        "Casablanca", "Dar Bouazza", "Dcheira El Jihadia", "El Jadida", "El Kelaa Des Sraghna", "Errachidia", "Essaouira", 
        "Fes", "Fquih Ben Salah", "Guelmim", "Ifrane", "Inezgane", "Kenitra", "Khemisset", "Khenifra", "Khouribga", 
        "Ksar El Kebir", "Larache", "Marrakech", "Meknes", "Mohammedia", "Nador", "Ouarzazate", "Oued Zem", "Oujda", "Rabat", 
        "Safi", "Salé", "Sefrou", "Settat", "Sidi Bennour", "Sidi Kacem", "Sidi Slimane", "Tan-Tan", "Tangier", "Taourirt", 
        "Taroudant", "Taza", "Temara", "Tetouan", "Tiznit", "Western Sahara",
     ],
   }

…ties.

Change array() function to short array syntax ([]) in the following
seeders for less code and to make things easy to maintenance.
- database/seeds/WorldCitiesTableSeeder.php
- database/seeds/WorldContinentsTableSeeder.php
- database/seeds/WorldCountriesTableSeeder.php

Also, I grouped cities by their countries, and countries by the continents,
make more sense in case someone wants to add certain data.
Copy link
Owner

@khsing khsing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, thx

@khsing khsing merged commit 6dc574f into khsing:master Feb 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants