PHP code example of dipta995 / laravel-codicefiscale

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

    

dipta995 / laravel-codicefiscale example snippets


'providers' => [
    Dipta995\LaravelCodiceFiscale\LaravelCodiceFiscaleServiceProvider::class,
],

'aliases' => [
    'CodiceFiscale' => Dipta995\LaravelCodiceFiscale\Facades\CodiceFiscale::class,
];

{
  "surname": "Rossi",
  "name": "Mario",
  "dob": "1985-07-15",
  "gender": "M",
  "placeCode": "H501" 
}

use CodiceFiscale;
//Check Validation
CodiceFiscale::validateFiscalCode($jsonData);
//Fetch All states
$jsonData = CodiceFiscale::getJsonData();
//Generate Fiscal Code with State validation or without validation
// using true as 6th param that is not mandatory
CodiceFiscale::generateCodiceFiscale($surname, $name, $dob, $gender, $placeCode,true);

bash
composer dump-autoload
php artisan config:clear
blade
@foreach ($jsonData as $key => $value)
    <p>{{ $key }}: {{ is_array($value) ? implode(', ', $value) : $value }}</p>
@endforeach