Download the PHP package chapdel/laravel-invoices without Composer
On this page you can find all versions of the php package chapdel/laravel-invoices. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-invoices
Laravel Invoices
This Laravel package provides an easy to use interface to generate Invoice PDF files with your provided data.
Invoice file can be stored, downloaded, streamed on any of the filesystems you have configured. Supports different templates and locales.
Originally package was developed on PHP 7.3.11 and Laravel 6.2, but should work on lower versions too.
Features
- Taxes - fixed or rate - for item or for invoice
- Discounts - fixed or by percentage - for item or for invoice
- Shipping - add shipping price to your invoices
- Automatic calculation - provide minimal set of information, or calculate yourself and provide what to print
- Due date
- Easy to customize currency format
- Serial numbers as you like it
- Templates
- Translations
- Global settings and overrides on-the-fly
Change log
Please see the changelog for more information on what has changed recently.
Installation
Via Composer
Laravel version <= 10
Laravel version <= 8
Laravel version <= 7
After installing Laravel Invoices, publish its assets, views, translations and config using the invoices:install
Artisan command:
Updates
Since it is evolving fast you might want to have latest template after update using Artisan command:
It will give a warning if you really want to override default resources
Or alternatively it can be done separately.
For Laravel version < 5.5
If you don't use auto-discovery, add the ServiceProvider to the providers array in config/app.php
If you want to use the facade to generate invoices, add this to your facades in config/app.php
Basic Usage
RandomController.php
See result Invoice_AA_00001.pdf.
Advanced Usage
See result Roosevelt Lloyd Ashley Medina.pdf.
Alternatives using facade
Optionally you can use a facade to make new party or item
Templates
After publishing assets you can modify or make your own template for invoices.
Templates are stored in the resources/views/vendor/invoices/templates
directory. There you will find default.blade.php
template which is used by default.
You can specify which template to use by calling template
method on Invoice object.
For example if you have resources/views/vendor/invoices/templates/my_company.blade.php
it should look like this:
Too see how things work in a template you can view default.blade.php
as an example.
Config
Available Methods
Almost every configuration value can be overrided dynamically by methods.
Invoice
General
- addItem(InvoiceItem $item)
- addItems(Iterable)
- name(string)
- status(string) - invoice status [paid/due] if needed
- seller(PartyContract)
- buyer(PartyContract)
- setCustomData(mixed) - allows user to attach additional data to invoice
- getCustomData() - retrieves additional data to use in template
- template(string)
- logo(string) - path to logo
- getLogo() - returns base64 encoded image, used in template to avoid path issues
- filename(string) - overrides automatic filename
- taxRate(float)
- shipping(float) - shipping amount
- totalDiscount(float) - If not provided calculates itself
- totalTaxes(float) - If not provided calculates itself
- totalAmount(float) - If not provided calculates itself
- taxableAmount(float) - If not provided calculates itself
Serial number
- series(string)
- sequence(int)
- delimiter(string)
- sequencePadding(int)
- serialNumberFormat(string)
- getSerialNumber() - returns formatted serial number
Date
- date(Carbon)
- dateFormat(string) - Carbon format of date
- payUntilDays(int) - Days payment due since invoice issued
- getDate() - returns formatted date
- getPayUntilDate() - return formatted due date
Currency
- currencyCode(string) - EUR, USD etc.
- currencyFraction(string) - Cents, Centimes, Pennies etc.
- currencySymbol(string)
- currencyDecimals(int)
- currencyDecimalPoint(string)
- currencyThousandsSeparator(string)
- currencyFormat(string)
- getAmountInWords(float, ?string $locale) - Spells out float to words, second parameter is locale
- getTotalAmountInWords() - spells out total_amount
- formatCurrency(float) - returns formatted value with currency settings '$ 1,99'
File
- stream() - opens invoice in browser
- download() - offers to download invoice
- save($disk) - saves invoice to storage, use ->filename() for filename
- url() - return url of saved invoice
- toHtml() - render html view instead of pdf
InvoiceItem
- title(string) - product or service name
- description(string) - additional information for service entry
- units(string) - measurement units of item (adds units columns if set)
- quantity(float) - amount of units of item
- pricePerUnit(float)
- discount(float) - discount in currency
- discountByPercent(float) - discount by percents discountByPercent(15) means 15%
- tax(float)
- taxByPercent(float)
- subTotalPrice(float) - If not provided calculates itself
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Author
License
GPL-3.0-only. Please see the license file for more information.
All versions of laravel-invoices with dependencies
barryvdh/laravel-dompdf Version ^2.0
illuminate/http Version ^9|^10
illuminate/support Version ^9|^10
symfony/http-foundation Version ^6.0