insologystudio/fatture-in-cloud

An interface to connect with fatture in cloud Api

2.0.0 2022-01-26 09:36 UTC

This package is auto-updated.

Last update: 2024-05-05 18:38:21 UTC


README

Latest Version on Packagist Total Downloads

Laravel Fatture in Cloud service. Take a look at contributing.md to see a to do list.

Installation

Via Composer

composer require insologystudio/fatture-in-cloud

In your .env file add FATTURE_CLOUD_API_SECRET and FATTURE_CLOUD_COMPANY_ID.

Usage

Please reference to fattureincloud.it api docs. You can get an *Api class instance from the FattureInCloud service by calling a method with the same *Api class name less the Api suffix. E.g. Retrive ClientsApi by calling $fattureInCloud->clients().

<?php
namespace App\Http\Controllers;

use FattureInCloud\Model\ListClientsResponse;
use InsologyStudio\FattureInCloud\FattureInCloud;

class ClientController extends Controller
{
    /**
     * @param FattureInCloud $fattureInCloud
     * @return ListClientsResponse 
     * @throws \FattureInCloud\ApiException
     */
    public function index(FattureInCloud $fattureInCloud): ListClientsResponse
    {
        $companyId = config('fatture-in-cloud.company_id');

        $clients = $fattureInCloud->clients()->listClients($companyId);
        
        return $clients;
    }
}

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits

License

license. Please see the license file for more information.