laravel print invoice pdf code example
Example 1: laravel invoice toturial
$ composer require laraveldaily/laravel-invoices
Example 2: laravel invoice toturial
use LaravelDaily\Invoices\Invoice;
use LaravelDaily\Invoices\Classes\Buyer;
use LaravelDaily\Invoices\Classes\InvoiceItem;
<...>
$customer = new Buyer([
'name' => 'John Doe',
'custom_fields' => [
'email' => '[email protected]',
],
]);
$item = (new InvoiceItem())->title('Service 1')->pricePerUnit(2);
$invoice = Invoice::make()
->buyer($customer)
->discountByPercent(10)
->taxRate(15)
->shipping(1.99)
->addItem($item);
return $invoice->stream();