Document Templates

screenshot of Document Templates
laravel

Document Templates

Laravel package for creating and managing user editable document templates with placeholders and various data sources.

Overview

The Document Templates Laravel package is designed to create and manage user-editable document templates. It provides the ability to add placeholders and populate them from various data sources such as models, collections, arrays, and objects. The package uses Twig as the main template engine but can be extended with other engines. These templates can be used for editable PDF documents like invoices and reports, email templates, or any other server-generated editable documents. Twig Sandbox Extension is used to secure the user-editable parts of the templates, with customizable sandbox behavior.

Features

  • Ability to create and manage user-editable document templates
  • Supports placeholders for dynamic data population from various sources
  • Uses Twig as the main template engine, with the option to extend with other engines
  • Templates can be used for editable PDF documents, email templates, and other server-generated editable documents
  • Secure user-editable parts of templates using Twig Sandbox Extension
  • Customizable sandbox behavior
  • Part of the Business Workflow Framework

Installation

To install the Document Templates package, follow these steps:

  1. Install the package using Composer:
composer require <package-name>
  1. Publish the migrations, views, Vue components, and config files:
php artisan vendor:publish --tag=<publish-group>

Replace <publish-group> with the desired publish group (migrations, views, components, config, ckeditor, js).

  1. Run the migration to set up the necessary tables:
php artisan migrate
  1. Add the package's routes to your routes file:
use <controller-class>;

Route::documentTemplates(<controller-class>::class);

Replace <controller-class> with the appropriate controller class name.

Summary

The Document Templates Laravel package provides a convenient way to create and manage user-editable document templates. It supports dynamic data population from various sources and provides secure editing of templates using Twig Sandbox Extension. With the ability to extend the template engine and support for various document types, it is a flexible and powerful tool for generating server-generated editable documents.

laravel
Laravel

Laravel is a powerful and elegant PHP framework that provides developers with a comprehensive set of tools and features to build robust web applications. It follows the Model-View-Controller (MVC) architectural pattern, offering a clean and organized structure for writing efficient and maintainable code.