Skip to content

[Core]: Online PDF invoice template editor #401

Description

@ririko5834

SMART Plan — [Core] Online PDF invoice template editor

Related: #98 (split-panel live preview / template editor), #96 (inline PDF preview on the invoice edit page).

Specific

Provide an in-browser HTML editor (e.g. CodeMirror or Monaco) inside the Filament admin panel where an admin can edit the Blade/HTML source of invoice PDF templates. The editor displays available template variables (placeholders) in a sidebar reference panel. A Preview button renders the template with dummy data so the admin can see the result without leaving the editor.

Measurable

  • A template editor page exists under the admin panel Settings section.
  • The editor loads the current template source.
  • Saving the editor content persists the template file (or a DB-backed template record).
  • The Preview button renders the template with sample invoice data and displays the HTML inline (no download required).
  • PHPUnit confirms the save endpoint persists the template content.

Achievable

  1. Create a Filament EditTemplate page or custom page under Modules/Core/Filament/Admin/Pages/.
  2. Embed a CodeMirror or Monaco editor via a Livewire component.
  3. The "Save" action writes the template content to a configurable path or a templates database table.
  4. The "Preview" action calls the PDF renderer with sample data and returns HTML via a Livewire modal.

Relevant

Template customisation currently requires direct file system access (SSH / FTP) which is inaccessible to non-technical users. An in-browser editor removes this barrier.

Time-bound

Sprint 6 — depends on the base PDF renderer being stable (#96, #190, #200).


Acceptance Criteria

  • Template editor page accessible to admin users.
  • CodeMirror / Monaco editor with HTML syntax highlighting.
  • Sidebar panel lists available placeholders ({{ $invoice->invoice_number }}, etc.).
  • Save action persists the template.
  • Preview action renders the template with sample data.
  • PHPUnit test: saving a template persists the content.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinedRefined with SMART plan / test suggestions

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions