PHP code example of informaticadoslago / censo-vias

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

    

informaticadoslago / censo-vias example snippets


Schema::create('provincias', function (Blueprint $t) {
    $t->id();
    $t->string('codigo', 2);
    $t->string('nombre', 50);
    $t->timestamps();
});

Schema::create('municipios', function (Blueprint $t) {
    $t->id();
    $t->foreignId('provincia_id')->nullable()->constrained('provincias');
    $t->string('codigo', 3);
    $t->string('nombre', 50);
    $t->timestamps();
});

Schema::create('tiposdevias', function (Blueprint $t) {
    $t->id();
    $t->string('codigo1', 5);
    $t->string('codigo2', 2);
    $t->string('nombre', 50);
    $t->timestamps();
});

Schema::create('vias', function (Blueprint $t) {
    $t->id();
    $t->foreignId('municipio_id')->nullable()->constrained('municipios');
    $t->string('codigo', 5);
    $t->foreignId('tipodevia_id')->nullable()->constrained('tiposdevias');
    $t->tinyInteger('posiciontvia')->default(0);
    $t->string('nombre', 50);
    $t->string('nombrecorto', 25);
    $t->timestamps();
});
bash
php artisan vendor:publish --tag=censo-vias-config
bash
php artisan informaticadoslago:censo-vias {ruta-al-fichero-VIAS} [opciones]
bash
php artisan informaticadoslago:censo-vias \
    storage/app/censo/VIAS.D251231.G260303 \
    --tipos=storage/app/censo/TiposVia.csv \
    --dry