1. Go to this page and download the library: Download beziworld/laravel-wfirma 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-wfirma example snippets
use Beziworld\WFirma\Data\InvoiceContent;
use Beziworld\WFirma\Data\InvoiceRequest;
use Beziworld\WFirma\Facades\WFirma;
$invoice = WFirma::createInvoice(new InvoiceRequest(
contractor: [
'name' => 'ACME Sp. z o.o.', 'nip' => '5261040828',
'street' => 'Prosta 1', 'zip' => '00-001', 'city' => 'Warszawa', 'email' => '[email protected]',
], // or an existing contractor id
contents: [
new InvoiceContent('Consulting', price: 1000.00, count: 2),
new InvoiceContent('Training', price: 500.00, vat: 'zw'),
],
paymentDate: now()->addDays(14),
priceType: 'netto', // prices are net; "brutto" for gross prices
attributes: ['id_external' => $order->number],
));
$invoice->fullNumber; // "FV 1/11/2026"
$invoice->total; // "2500.00"
WFirma::sendInvoice($invoice->id, '[email protected]', 'Your invoice');
$pdf = WFirma::pdf($invoice->id);