Repository navigation
Replies: 1 comment
|
You don't need to write the file from scratch — there's a command that clones a built-in design for you, and that clone is the example you're looking for. Let the generator write the first versiondocker compose exec invoiceshelf php artisan make:template my-templateIf you started the container from Portainer rather than compose, open Containers → invoiceshelf → Console ( It asks whether you want an invoice or an estimate, copies the first built-in design of that type, rewrites the copy's That's the bit the docs page doesn't spell out: a hand-created If you'd rather read an example firstThe three built-in invoice designs are in the repo:
Estimates are the same layout under Variables you can useEach template is rendered with the document's data already shared in:
Two includes worth keeping@include('pdf_templates::invoice.partials.table')
@include("app.pdf.partials.fonts")The first is the line-items table. Careful here: that partial is written once, the first time you create a custom invoice template, and every later custom invoice template includes the same file. Editing it changes the table in all of them. If you want one template with a different table, copy the partial to a new name and point that template's The second pulls in the Iterating without regenerating a PDF each timeAppend That renders the template as plain HTML in the browser, so you get your browser's dev tools for the CSS instead of squinting at a regenerated PDF. Two things that catch people on DockerThe path has an Make sure Also drop a |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I installed InvoiceShelf via Portainer—it's cool software that I'd really like to use. Unfortunately, I don't understand how to create a custom template for my PDF invoices. The explanation at https://docs.invoiceshelf.com/guide/custom-templates.html isn't clear to me.
Is there perhaps a more detailed guide available? I created a
.blade.phpfile, and it does show up in the list of options, but what should the file's content look like? Is there an example?Thanks a lot for your help.
All reactions