PHP code example of beziworld / laravel-ifirma

1. Go to this page and download the library: Download beziworld/laravel-ifirma library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

beziworld / laravel-ifirma example snippets


use Beziworld\IFirma\Data\Contractor;
use Beziworld\IFirma\Data\InvoiceRequest;
use Beziworld\IFirma\Data\Position;
use Beziworld\IFirma\Facades\IFirma;

$id = IFirma::createInvoice(new InvoiceRequest(
    contractor: new Contractor('ACME Sp. z o.o.', '00-001', 'Warszawa', nip: '5261040828', street: 'Prosta 1', email: '[email protected]'),
    positions: [
        new Position('Website development', unitPrice: 6150.00, quantity: 1, vatRate: 0.23),
        new Position('Training', unitPrice: 500.00, vatRate: null),     // VAT exempt
    ],
    issueDate: now(),
    paymentDate: now()->addDays(14),
    paymentMethod: 'PRZ',                                              // transfer; GTK cash, KAR card, P24, TPA, ...
    calculateFrom: 'BRT',                                             // prices are gross; "NET" for net prices
));

IFirma::sendByEmail($id);
IFirma::sendToKsef($id);
$pdf = IFirma::pdf($id);

IFirma::invoices(from: now()->startOfMonth(), filters: ['status' => 'nieoplacone']);   // sterPayment('12/2026', 246.00);       // payment for a domestic invoice
IFirma::limit();                                  // ['used' => 12, 'granted' => 1000]
IFirma::createBill([...]);                        // rachunekkraj payload, key "rachunek"
IFirma::call('POST', 'fakturawdt.json', 'faktura', [...]);   // any other resource, signed with the given key