With this laravel package you can interact with the Cerca Imprese OpenAPI.
It's built on top of the amazing Saloon Package and requires PHP8.
You can install the package via composer:
composer require weble/cercaimprese
You can publish the config file with:
php artisan vendor:publish --tag="cercaimprese-config"
This is the contents of the published config file:
return [
'token' => env('CERCAIMPRESE_TOKEN', ''),
'test' => env('CERCAIMPRESE_TEST', true)
];
You can use directly the Facade to interact with the package:
Result is a Laravel Collection of the data of the company requested
$result = \Weble\CercaImprese\Facades\CercaImprese::base(search: '[PIVA_OR_CF_OR_ID]');
The result is a Laravel Collection of the resulting list of companies.
You can search by anoyone of the parameters, or all of them together in any combination (thanks php8 named parameters!).
$result = \Weble\CercaImprese\Facades\CercaImprese::advanced(
denominazione: $denominazione,
provincia: $provincia,
codice_ateco: $codice_ateco,
fatturato_min: $fatturato_min,
fatturato_max: $fatturato_max,
dipendenti_min: $dipendenti_min,
dipendenti_max: $dipendenti_max,
limite: $limite,
dry_run: $dry_run
);
You need either an env variable set for CERCAIMPRESE_TOKEN
or a .env
file with the same variable set.
composer test
Please see CHANGELOG for more information on what has changed recently.
The MIT License (MIT). Please see License File for more information.