PHP code example of edwinlll / regionbuilder

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

    

edwinlll / regionbuilder example snippets


php artisan regionbuilder:generate -t myregionsname

Schema::create($tablename, function(Blueprint $table)
{
    $table->increments('id');
    $table->integer('pid')->unsigned()->default(0)->comment('父类自增ID');
    $table->integer('region_grade')->unsigned()->default(0)->comment('地区层级');
    $table->string('name', 30)->comment('名称');
    $table->string('code', 12)->nullable()->comment("行政区代码");
    $table->string('province_code', 2)->nullable()->comment("省份、直辖市、自治区");
    $table->string('city_code', 4)->nullable()->comment("城市");
    $table->string('area_code', 6)->nullable()->comment("区县");
    $table->string('street_code', 9)->nullable()->comment("乡镇、街道");
    $table->timestamps();
    $table->softDeletes();
});

composer san iseed myregionsname