dipta995 / laravel-codicefiscale
A Laravel package for codice fiscale functionalities
1.5.0
2025-02-07 18:43 UTC
Requires
- php: ^7.4 | ^8.0
- illuminate/support: ^7.0 | ^8.0 | ^9.0 | ^10.0
- laravel/framework: ^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0
Requires (Dev)
- orchestra/testbench: ^4.0 | ^5.0 | ^6.0 | ^7.0
- phpunit/phpunit: ^7.5 | ^8.0 | ^9.0
README
Here's a short and concise version for installation and usage with an example:
Laravel Codice Fiscale
A Laravel package to handle codice fiscale operations with secure JSON data.
🚀 Installation
composer require dipta995/laravel-codicefiscale
If auto-discovery doesn't work, register manually in config/app.php
:
'providers' => [ Dipta995\LaravelCodiceFiscale\LaravelCodiceFiscaleServiceProvider::class, ], 'aliases' => [ 'CodiceFiscale' => Dipta995\LaravelCodiceFiscale\Facades\CodiceFiscale::class, ];
Run:
composer dump-autoload php artisan config:clear
📦 Usage
1️⃣ Fetch JSON Data in Controller
Example For ROME:
{ "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);
2️⃣ Display JSON Data in Blade
@foreach ($jsonData as $key => $value) <p>{{ $key }}: {{ is_array($value) ? implode(', ', $value) : $value }}</p> @endforeach
✅ Done!
Your package is ready to use.