PHP code example of ajtarragona / anicom-client

1. Go to this page and download the library: Download ajtarragona/anicom-client 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 / anicom-client example snippets


use Anicom;
...
public  function  test(){
    $animal=Anicom::consultaAnimal('123456');
    ...
}

'aliases'  =>  [
    ...
    'Anicom'  =>  Ajtarragona\Anicom\Facades\Anicom::class
]

use Ajtarragona\Anicom\Providers\AnicomProvider;
...

public  function  test(AnicomProvider  $client){
    $animal=$client->consultaAnimal('123456');
    ...
}

...
public  function  test(){
    $animal=anicom()->consultaAnimal('123456');
    ...
}

...
public  function  test(){
    $animal=anicom()->altaPropietari([
        'tipus_persona' => 1,    
        'tip_document' => 1,    
        'document' => '12345678J',    
        'nom' => 'PEPITO',    
        'cognoms' => 'PEREZ LOPEZ',    
        'rao_social' => '',    
        'sexe' => 2,    
        'ambit' => 1,    
        'tipus_via' => 1,    
        'via' => 'FAKE STREET',   
        'numero' => 1,   
        'municipi' => 17118,    
        'telefon' => '666666666'
    ]);
    
}

...
public  function  test(){
    $animal=anicom()->altaAnimal([
        'identificacio' => '123456789012345',    
        'lloc_marcatge' => 1,    
        'especie' => 1,    //Gos
        'sexe' => 1,    //mascle
        'raca' => 2,    //fox terrier
        'idPkPare' => '11111116T'
        'nom_animal'=>'Bobby',
    ]);
    
}
bash
php artisan vendor:publish --tag=ajtarragona-anicom-config