Custom Templates?
sprklinginfo opened this issue · 2 comments
sprklinginfo commented
thank you for the great package. After installation, I see the default template. In the readme, it claims the 'templates' feature. Does it mean we can add custom templates? how to use the new templates? Thanks!
mc0de commented
@sprklinginfo thank you
- make sure you have published all assets with
php artisan invoices::install
- then you can put your templates to
resources/views/vendor/invoices/templates
for example resources/views/vendor/invoices/templates/mytemplate.blade.php
- and when creating invoice just specify template name
$invoice = Invoice::make()
->buyer($customer)
->discountByPercent(10)
->taxRate(15)
->shipping(1.99)
->addItem($item)
->template('mytemplate');
You can lookup in default template resources/views/vendor/invoices/templates/default.blade.php
how certain things are implemented.
sprklinginfo commented
terrific! Many thanks.