Download the PHP package kukux/pdf-template-builder without Composer

On this page you can find all versions of the php package kukux/pdf-template-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 pdf-template-builder

PDF Template Builder

Latest Version on Packagist Total Downloads License

Installation

1. Require the package

2. Publish and run the migration

3. Publish assets

The builder UI is a React SPA bundled with Vite. The package ships pre-built JS in resources/dist/. Publish to public/:

Re-run this command after each package update to get the latest bundle.

For maintainers / contributors — to rebuild the bundle from JSX source:

ⓘ Filament v3 / v4 / v5 auto-detection

The plugin ships two parallel Resource implementations and aliases the canonical class name to the right one based on the Filament major version installed in your project.

Detected Class actually loaded
Filament v3 (no Filament\Schemas\Schema class) Kukux\PdfTemplateBuilder\Filament\Resources\V3\PdfTemplateResource
Filament v4 / v5 (Filament\Schemas\Schema exists) Kukux\PdfTemplateBuilder\Filament\Resources\V4\PdfTemplateResource

Detection happens in PdfTemplateBuilderServiceProvider::register() via class_alias, before Filament's panel resolves any resource. You always reference the canonical Kukux\PdfTemplateBuilder\Filament\Resources\PdfTemplateResource::class — never the V3/V4 variants directly.

If you ever see Class "Kukux\…\PdfTemplateResource" not found after upgrading, run composer dump-autoload. PSR-4 lookup needs to miss so the alias can be consulted, and a stale optimized classmap can short-circuit that.

4. Register the plugin in your Filament panel

In your PanelProvider (e.g. app/Providers/Filament/AdminPanelProvider.php):

5. Register your models (optional but recommended)

Configure the Eloquent models whose fields will appear in the builder sidebar:

Alternatively, configure them in config/pdf-template-builder.php after publishing the config:

6. (Optional) Customize sidebar navigation

You can place the "PDF Templates" entry inside a Filament navigation group and control its sort order:

Or via the published config (config/pdf-template-builder.php):

Heads up — avoid this error

This is thrown when config('pdf-template-builder.navigation_group') resolves to null. To prevent it:

  • If you published the config before v1.2.0, open config/pdf-template-builder.php and change 'navigation_group' => null to 'navigation_group' => '' (or to your preferred group name).
  • Or set PDF_TEMPLATE_NAVIGATION_GROUP="" in your .env rather than leaving it unset.
  • Or call ->navigationGroup('') explicitly when registering the plugin.

The same applies if you override the value at runtime — always pass a string, never null.

7. (Optional) Configure storage

By default PDF backgrounds are stored on the public disk under pdf-templates/backgrounds/. Override via the plugin or .env:

Or via the plugin:


What gets added to your app

Generating PDFs

1. Install a PDF engine (optional but recommended)

The plugin auto-detects dompdf/dompdf and uses it for output. Without it, render() falls back to HTML (browser print → save as PDF still works).

2. Drop a "Generate PDF" button into any Filament page

On a ViewRecord / EditRecord page (header action):

As a row action on a Resource table:

Dynamic template selection:

3. Programmatic rendering

4. Field token resolution

Fields placed in the builder have a key like invoice.number or customer.email. At render time:

5. Choosing a PDF engine

The plugin ships three engines. Pick based on your needs:

Engine When to use Requires
HtmlEngine (default fallback) Quick preview; user prints to PDF from browser.
DompdfEngine (auto-detected) Generic HTML→PDF. Good for templates with no background or simple backgrounds. composer require dompdf/dompdf
FpdiEngine You uploaded a designed PDF as the background and want the original PDF preserved exactly. Stamps fields directly onto the original page. composer require setasign/fpdi tecnickcom/tcpdf

Wire your choice on the plugin:

You can also implement Kukux\PdfTemplateBuilder\Rendering\Contracts\PdfEngine (or TemplateAwarePdfEngine for non-HTML pipelines like Browsershot) and register your own.

6. Running the test suite

The package ships with Pest tests covering routes, the field resolver, the HTML renderer, the filename pattern, and basic model persistence. Run them after every change.

7. Authorization

Templates use a default-permissive PdfTemplatePolicy. Override it in your AuthServiceProvider:


All versions of pdf-template-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
filament/filament Version ^3.0 || ^4.0 || ^5.0
illuminate/contracts Version ^11.0 || ^12.0
illuminate/database Version ^11.0 || ^12.0
illuminate/http Version ^11.0 || ^12.0
illuminate/routing Version ^11.0 || ^12.0
illuminate/support Version ^11.0 || ^12.0
spatie/laravel-package-tools Version ^1.15
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 kukux/pdf-template-builder contains the following files

Loading the files please wait ...