dvsoftsrl/pianeta-fibra-coverage

Client PHP per API di copertura PianetaFibra

1.1.2 2025-09-24 09:09 UTC

This package is auto-updated.

Last update: 2025-09-24 09:10:19 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require dvsoftsrl/pianeta-fibra-coverage

You can publish the config file with:

php artisan vendor:publish --tag="pianeta-fibra-coverage-config"

This is the contents of the published config file:

return [
    // Token API (header 'authorization: Bearer <TOKEN>')
    'token' => env('PIANETAFIBRA_TOKEN', ''),

    // Endpoint base API
    'base_uri' => env('PIANETAFIBRA_BASE_URI', 'https://api.pianetafibra.it/v2/api.php'),

    // HTTP client
    'timeout' => env('PIANETAFIBRA_TIMEOUT', 10),
    'max_retries' => env('PIANETAFIBRA_MAX_RETRIES', 2),

    // Caching
    'use_cache' => env('PIANETAFIBRA_USE_CACHE', true),
    // Se valorizzato, usa questo store di cache (es. 'redis', 'file'); altrimenti usa quello di default se use_cache=true
    'cache_store' => env('PIANETAFIBRA_CACHE_STORE', null),
    // TTL per anagrafiche city/street/civic (secondi)
    'cache_ttl_seconds' => env('PIANETAFIBRA_CACHE_TTL', 43200),

    // Comportamento di default per la funzione totale (puoi sempre override col parametro)
    // true => match esatto o eccezione; false => ritorna ResolveOutcome::ambiguous(...) con alternative
    'default_match_or_fail' => env('PIANETAFIBRA_MATCH_OR_FAIL', true),
];

Usage

PianetaFibraCoverage::resolveCoverageFromLocation($location, CustomerType::Azienda);

Testing

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.