PHP code example of anandpilania / laravel-country.io

1. Go to this page and download the library: Download anandpilania/laravel-country.io 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/ */

    

anandpilania / laravel-country.io example snippets

sh
$ php artisan help countryio
sh
php artisan countryio
sh
php artisan countryio --to=db
sh
Artisan::command('countries', function () {
    $count = $this->ask('How many entries?');
    $model = config('countryio.model', \App\Models\CountryIO::class);

    if(!class_exists($model)) {
        $this->error($model . ' not exists!');
    }

    foreach ((new $model)->take($count ?? 10)->get() as $c) {
        $output = '';
        foreach (array_merge(config('countryio.cols', []), config('countryio.cols_' . config('countryio.cols_type', 'plain'), [])) as $col => $enabled) {
            if ($enabled) {
                $output .= $c->{$col} . ', ';
            }
        }

        $this->comment($output);
    }
})->purpose('Check CountryIO');