Download the PHP package maestrodimateo/simple-word without Composer

On this page you can find all versions of the php package maestrodimateo/simple-word. 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 simple-word

Simple Word

Latest Version on Packagist License

A simple, dev-friendly Laravel wrapper for PHPWord.

Built on top of PHPWord's TemplateProcessor, this package provides a fluent API for generating Word documents from .docx templates — with variables, tables, images, conditional blocks, PDF conversion, and Mailable-style template classes out of the box.

Installation

Publish the config:

Add to your .env (optional):

By default, templates are resolved from resources/templates/word.


Quick Start

Replace placeholders

In your .docx template, use ${variable} placeholders:

Hello ${name}, your order ${ref} was placed on ${date}.

Bulk replace

Nested arrays (dot notation)

Nested associative arrays are automatically flattened with dot notation. This is useful for grouping related data:

This replaces ${client.name}, ${client.email}, ${client.address.city}, ${client.address.zip}, and ${date} in the template.


Tables

In your template, prefix table cell placeholders with a group name. See PHPWord cloneRowAndSetValues:

${items.produit} ${items.prix}

The table row is cloned once for each entry and placeholders are filled automatically.


Images

Use ${placeholder} in your template where an image should appear. See PHPWord setImageValue:

Local file

Remote URL (GED, CDN, Alfresco, etc.)

image() accepts HTTP/HTTPS URLs. The image is downloaded automatically to a temp file:

From a Laravel filesystem disk

Use imageFromDisk() to load images from any configured Laravel filesystem disk (S3, SFTP, custom Alfresco adapter, etc.):


Conditional Blocks

In your template, wrap conditional content with block markers:

${has_discount} You benefit from a 10% loyalty discount! ${/has_discount}

When the condition is true, the content is kept (markers removed). When false, the entire block is removed.


Template Classes (Mailable-style)

For reusable, testable templates, generate a dedicated class:

This creates app/Word/InvoiceDocument.php:

Use it anywhere:


PDF Conversion

Convert any document to PDF with toPdf():

Supported drivers

Driver Requires Quality
libreoffice (default) LibreOffice installed on server Excellent
gotenberg Gotenberg Docker container Excellent

Configuration

Custom converter

Implement the PdfConverter interface for any other conversion service:


Output Methods

All output methods are available on both DocumentBuilder (docx) and PdfBuilder (after toPdf()):

Method Description
save($path) Save to a local file path
saveTo($disk, $path) Save to a Laravel filesystem disk (S3, local, etc.)
download($filename) Return a download HTTP response
stream($filename) Return an inline HTTP response (preview in browser)

Advanced Usage

Access the underlying PHPWord TemplateProcessor for features not covered by the fluent API:


Facade

Helper


Configuration


Artisan Commands

Command Description
make:word-template Generate a new WordTemplate class

Testing


Useful PHPWord Links


License

MIT

Credits


All versions of simple-word with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3 || ^8.4
phpoffice/phpword Version ^1.3
illuminate/support Version ^12.0|^13.0
symfony/process Version ^7.0|^8.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 maestrodimateo/simple-word contains the following files

Loading the files please wait ...