Download the PHP package chanthoeun/filament-document-builder without Composer

On this page you can find all versions of the php package chanthoeun/filament-document-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package filament-document-builder

Filament Document Builder

A powerful and simplified Filament PHP plugin to build dynamic document templates (like invoices, certificates, and registration forms) using a full-featured TinyMCE editor, and automatically export them to PDFs with native support for complex scripts like Khmer.

It is designed to easily integrate with standalone Filament panels or with other plugins like chanthoeun/filament-custom-forms.

Features


Installation

1. Requirements

(Note: Node.js, Puppeteer, and Chromium are no longer required!)

2. Install via Composer

3. Publish & Run Migrations

You can publish the migration file to customize the table prefix or structure before running it:

After publishing, run the migrations to create the document_templates table:

4. Register the Plugin

Add the plugin to your Filament Panel provider (app/Providers/Filament/AdminPanelProvider.php):


Configuration & Publishing

Because this plugin is built with Spatie\LaravelPackageTools, all publishing logic is wired up natively.

1. Publishing the Config File

To customize default paper sizes, orientations, and margins, publish the config file:

This will create config/filament-document-builder.php in your application.

2. Publishing Translations

To override the default English and Khmer language files, run:

3. Publishing the Document Template Resource

If you want complete control over the DocumentTemplateResource (e.g., to change its location, permissions, or logic), you can safely publish it to your application by running:

This command intelligently copies the resource files into your app/Filament/Resources directory and automatically updates all namespaces. The plugin will automatically detect that you've published the resource and will gracefully yield control, preventing any conflicts.


Usage

1. Creating a Template

  1. Navigate to the Document Builder resource in your Filament sidebar.
  2. Click Create Document Template.
  3. Set the layout rules (A4, Portrait) in the Template Details tab.
  4. Construct your document using the Document Designer tab. Because it uses TinyMCE, you can easily insert and modify highly complex HTML tables.
  5. If you plan to inject dynamic variables, type them using standard brace syntax (e.g., Hello {{ name }}!).

Built-in Shapes and Forms Support

This plugin adds several pre-configured shapes to the TinyMCE editor to make designing forms significantly easier:

Flexbox Support in mPDF

By default, mPDF does not support modern CSS Flexbox (display: inline-flex), which often breaks designs created in TinyMCE. This plugin automatically polyfills Flexbox behaviors (such as inline-flex, align-items, and justify-content) directly in PHP during the export process. Your TinyMCE layouts will render pixel-perfect in the final PDF without requiring complex CSS hacks!

2. Looping over Data (Table Repeaters)

If you need to iterate over an array or Eloquent relationship (like line items on an invoice), you can use the built-in {{#foreach}} syntax directly in your template.

Switch your TinyMCE editor to Source Code (<>) view and wrap your repeating elements like this:

Handling Calculations (e.g., Invoices)

The document rendering engine intentionally avoids executing arbitrary PHP code within the template for security and performance reasons. Therefore, you cannot perform inline math like {{ item.qty * item.price }} inside the TinyMCE editor.

To handle calculations such as line totals, taxes, or grand totals, you should use Laravel Eloquent Accessors directly on your models.

Example (Line Item Total): On your InvoiceItem model, add an accessor:

Now, you can simply use {{ item.total }} inside your {{#foreach}} loop!

Example (Invoice Grand Total): On your parent Invoice model:

Then, anywhere in your document, you can output the grand total using {{ grand_total }}.

3. Additional Data Sources (Multi-Model Support)

If your document requires data from multiple independent models (e.g., a student application form that needs global SchoolSettings or a specific Principal user), you can map them entirely through the UI without touching any code!

  1. In the Template Details tab, click Add to additional data sources.
  2. Give it a Variable Name (e.g., school).
  3. Select the Database Model (e.g., App\Models\SchoolSetting) and choose "First Record" or "Latest Record".
  4. The TinyMCE editor will instantly update its Insert Variable dropdown to include all the fields from your new model (e.g., school.name, school.address).

The PDF Engine will automatically execute these queries at runtime and securely merge the data into your document!

4. Exporting PDFs from your Resources

To allow users to download a PDF of a specific record or bulk download multiple records, use the built-in Action classes.

Row Action (Single PDF)

Add DownloadPdfAction to your resource's table actions to download individual records:

Page Header Action (Bulk PDF)

Add DownloadAllPdfAction to your List page header to download multiple records at once (combined into a single PDF with pagebreaks):


Changelog

v1.0.15

v1.0.13

v1.0.12

v1.0.11

v1.0.10

v1.0.9

v1.0.8

v1.0.7

v1.0.6

v1.0.5

v1.0.4

v1.0.3

v1.0.2

v1.0.1

v1.0.0


License

The MIT License (MIT).


All versions of filament-document-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
filament/filament Version ^4.0|^5.0
carlos-meneses/laravel-mpdf Version ^2.1
amidesfahani/filament-tinyeditor Version ^4.0|^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chanthoeun/filament-document-builder contains the following files

Loading the files please wait ...