PHP code example of open-afghanistan / provinces

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

    

open-afghanistan / provinces example snippets


// DatabaseSeeder.php

use OpenAfghanistan\Provinces\Database\Seeders\ProvincesSeeder;

$this->call(ProvincesSeeder::class);

// DatabaseSeeder.php

use OpenAfghanistan\Provinces\Database\Seeders\KabulProvinceSeeder;

$this->call(KabulProvinceSeeder::class);

use OpenAfghanistan\Provinces\Models\Province;

Province::factory()->create();

use OpenAfghanistan\Provinces\Models\District;

District::factory()->create();
bash
php artisan vendor:publish --tag=provinces-migration