PHP code example of nevadskiy / laravel-geonames

1. Go to this page and download the library: Download nevadskiy/laravel-geonames library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nevadskiy / laravel-geonames example snippets


protected function schedule(Schedule $schedule)
{
    $schedule->command('geonames:daily-update')->dailyAt('4:00');
}

'seeders' => [
    Database\Seeders\Geo\ContinentSeeder::class,
    Database\Seeders\Geo\ContinentTranslationSeeder::class,
    Database\Seeders\Geo\CountrySeeder::class,
    Database\Seeders\Geo\CountryTranslationSeeder::class,
    Database\Seeders\Geo\DivisionSeeder::class,
    Database\Seeders\Geo\DivisionTranslationSeeder::class,
    Database\Seeders\Geo\CitySeeder::class,
    Database\Seeders\Geo\CityTranslationSeeder::class,
]



namespace Database\Seeders\Geo;

use App\Models\Geo\City;
use Illuminate\Support\Str;use Nevadskiy\Geonames\Seeders\CitySeeder as Seeder;

class CitySeeder extends Seeder
{
    /**
     * {@inheritdoc}
     */
    protected static $model = City::class;

    /**
     * {@inheritdoc}
     */
    protected function mapAttributes(array $record): array
    {
        return array_merge(parent::mapAttributes($record), [
            'id' => (string) Str::uuid(),
        ]);
    }
}

'flare_middleware' => [
    ...
    AddQueries::class => [
        'maximum_number_of_collected_queries' => 200,
        'report_query_bindings' => false,
    ],
    ...
]

'ignore_commands' => [
    'geonames:seed',
    'geonames:daily-update',
    'geonames:sync',
]
bash
php artisan vendor:publish --tag=geonames-migrations --tag=geonames-models
bash
php artisan migrate
bash
php artisan geonames:seed
bash
php artisan geonames:sync
bash
php artisan vendor:publish --tag=geonames-seeders
bash
php artisan vendor:publish --tag=geonames-config