PHP code example of kenyalang / countries

1. Go to this page and download the library: Download kenyalang/countries 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/ */

    

kenyalang / countries example snippets


php artisan vendor:publish --provider="\Kenyalang\Countries\CountriesServiceProvider" --tag=config

php artisan migrate

ENABLE_ALL_COUNTRIES=true

\Kenyalang\Countries\Models\Country::where('name', 'United States')->activate();

\Kenyalang\Countries\Models\Country::where('name', 'United States')->deactivate();

\Kenyalang\Countries\Models\Country::active()->get();

class User extends Model
{
    use \Kenyalang\Countries\Traits\HasCountry;
}

User::withLocale()->first();