Skip to content

docs: fix the custom templates path, and fill in what was missing - #21

Merged
gdarko merged 1 commit into
masterfrom
docs/custom-templates-path-fix
Aug 1, 2026
Merged

docs: fix the custom templates path, and fill in what was missing#21
gdarko merged 1 commit into
masterfrom
docs/custom-templates-path-fix

Conversation

@gdarko

@gdarko gdarko commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

The path was wrong

storage/templates/pdf/ does not exist. Templates are found under storage/app/templates/pdf/ — registered in AppServiceProvider as the pdf_templates view namespace and as the disk root in config/filesystems.php.

This is wrong for both 2.x and 3.x (InvoiceShelf-2 registers the identical path), which is why it goes on master rather than waiting for the v3 docs branch. Anyone following the page literally created files that were never picked up, with no error to explain why.

What else was missing

Things you currently have to read the source to find out:

  • The variables a template receives$invoice/$estimate, $customFields, the three addresses, $notes, $logo, $taxes.
  • ?preview on the PDF URL renders the template as HTML in the browser. It is by far the fastest way to iterate on one, and was undocumented.
  • The font partial and why to keep the include.
  • The shared line-items table, which is the sharpest edge here: partials/table.blade.php is written once per type and then included by every custom template of that type, so editing it changes them all. That is very much not what a file living under your template's directory looks like it does.

Smaller fixes

  • The .png is described as what it actually is: without one the tile renders blank, rather than falling back to anything.
  • Dropped the version note, whose link pointed at the 2.0.0 tag while claiming v2.1.0.

The documented path was wrong: storage/templates/pdf/ does not exist. Templates
are found under storage/app/templates/pdf/, in both 2.x and 3.x, so anyone
following this page literally created files that were never picked up.

Also adds what the page left out and people have to discover by reading source:
the variables a template is rendered with, the ?preview parameter for iterating
on one as HTML, the font partial and why to keep it, and -- the sharpest edge --
that partials/table.blade.php is written once per type and then shared by every
custom template of that type, so editing it changes them all.

The .png is described as what it is: without one the tile renders blank rather
than falling back to anything.

Drops the version note, whose link pointed at the 2.0.0 tag while claiming
v2.1.0.
@gdarko
gdarko merged commit 4d46a9f into master Aug 1, 2026
1 check passed
@gdarko
gdarko deleted the docs/custom-templates-path-fix branch August 1, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant