weble / cercaimprese
Laravel Package for OpenAPI.it Cerca Imprese Integration
Requires
- php: ^8.0
- illuminate/contracts: ^9.0
- sammyjo20/saloon-laravel: ^0.10.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- nunomaduro/collision: ^6.0
- nunomaduro/larastan: ^2.0.1
- orchestra/testbench: ^7.0
- pestphp/pest: ^1.21
- pestphp/pest-plugin-laravel: ^1.1
- phpstan/extension-installer: ^1.1
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^9.5
- spatie/laravel-ray: ^1.26
This package is auto-updated.
Last update: 2024-12-09 14:04:27 UTC
README
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.
Installation
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) ];
Usage
You can use directly the Facade to interact with the package:
Base Request
Result is a Laravel Collection of the data of the company requested
$result = \Weble\CercaImprese\Facades\CercaImprese::base(search: '[PIVA_OR_CF_OR_ID]');
Advanced Request
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 );
Testing
You need either an env variable set for CERCAIMPRESE_TOKEN
or a .env
file with the same variable set.
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.