PHP code example of ajtarragona / vialer

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

    

ajtarragona / vialer example snippets


use Vialer;
...
public function test(){
    $paisos=Vialer::paisos();
    ...
}

use Ajtarragona\Vialer\Providers\VialerProvider;
...
public function test(VialerProvider $vialer){
	$vies=$vialer->getAllVies();
	...
}

...
public function test(){
	$tercer=vialer()->getAllVies();
	...
}

use Districtes;
...
public function test(){
    $dissec=Districtes::getDistricteISeccio(41.111,12.3323);
    ...
}

use Ajtarragona\Vialer\Providers\DistricteSeccioProvider;
...
public function test(DistricteSeccioProvider $disprov){
	$dissec=$disprov->getDistricteISeccio(41.111,12.3323);
	...
}

...
public function test(){
	$dissec=districtes()->getDistricteISeccio(41.111,12.3323);
	...
}

use Catastro;
...
public function test(){
    $via=Catastro::getVia(1234);
    ...
}

use Ajtarragona\Vialer\Providers\CatastroProvider;
...
public function test(CatastroProvider $catastro){
	$vies=$catastro->getVia(1234);
	...
}

...
public function test(){
	$via=catastro()->getVia(1234);
	...
}

@vialerFormControl([
	'name'=>'vialer1',
	'class' => 'mb-3',
	'color'=>'info',
	'show_map'=>false,
	'show_refcat'=>true,
	'show_xy'=>true,
	"search_xy"=>false,
	"search_refcat"=>false,
	"btn_parcela"=>true,
	"value"=> [
		"via"=> [
			"tipus" => "CR",
			"nom" => "DE LA UNIO",
			"codi" => 3120
		],
		"numero" => 12,
		"refcat"=> "3231506CF5533A0016DM",
		"location" =>[
			"lat" => "41.1147391577075",
			"lng" => "1.25146962624948",
		]
	],
	"readonly" =>true
])


"vialer1" => array:15 [
    "via" => array:3 [
      "tipus" => "CR"
      "nom" => "DE LA UNIO"
      "codi" => "3120"
    ]
    "numero" => "13"
    "lletra" => null
    "escala" => null
    "bloc" => null
    "planta" => "01"
    "porta" => "01"
    "codi_postal" => "43001"
    "provincia" => "TARRAGONA"
    "municipi" => "TARRAGONA"
    "districte" => "5"
    "seccio" => "2"
    "districte_administratiu" => "CENTRE"
    "refcat" => "3332212CF5533A0002FS"
    "location" => array:2 [
      "lat" => "41.1151162899822"
      "lng" => "1.25189613335773"
    ]
  ]

bash
php artisan vendor:publish --tag=ajtarragona-vialer-assets
bash
php artisan vendor:publish --tag=ajtarragona-vialer-assets --force
bash
php artisan vendor:publish --tag=ajtarragona-vialer-config