novay/laravel-word-template

Package Laravel untuk melakukan penggantian kata pada file menggunakan template dokumen (.doc atau .docx) yang sudah disediakan.

2.0.2 2025-09-14 08:50 UTC

This package is auto-updated.

Last update: 2025-09-16 04:50:40 UTC


README

Latest Version Total Downloads License

Laravel Word Template is a Laravel package built on top of PHPWord for creating, manipulating, and exporting Word/Office documents. It offers full support for template replacement, looping, images, builder mode, watermarks, merging, and even digital signatures.

Example

🚀 Installation

composer require novay/laravel-word-template

Publish the configuration:

php artisan vendor:publish --provider="Novay\Word\Providers\WordServiceProvider"

⚡ Basic Usage

1️⃣ Replace Value

return Word::template(storage_path('app/templates/replace-values.docx'))
    ->setValue('nama', 'Novianto Rahmadi')
    ->setValue('app', 'Laravel WordTemplate')
    ->download('output.docx');

2️⃣ Replace Images

return Word::template(storage_path('app/templates/template.docx'))
    ->setImage('logo', public_path('logo.png'), [
        'width' => 120,
        'height'=> 120,
        'ratio' => true
    ])
    ->download('output.docx');

📚 Full Documentation

For more comprehensive documentation, please visit: 👉 https://word.btekno.id