novay / laravel-word-template
Package Laravel untuk melakukan penggantian kata pada file menggunakan template dokumen (.doc atau .docx) yang sudah disediakan.
Installs: 13 012
Dependents: 0
Suggesters: 0
Security: 0
Stars: 39
Watchers: 3
Forks: 19
Open Issues: 0
Requires
- php: >=8.1
- phpoffice/phpword: ^1.4
Requires (Dev)
- mockery/mockery: ^1.6
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpunit/phpunit: ^10.0
README
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.
🚀 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