1 year ago

How to export laravel blade to word document

Posted 1 year ago by konrms

I want to add export to word functinality to one of my blades in Laravel. I have also asked that at stackoverflow hoping to get some help!

I have already run

composer require phpoffice/phpword

at cmd but I can't succesfully implement my export. Below you can see the blade I want to export to word. It is a very simple blade which takes fist and last name from a db table. I want to add a button at the bottom that exports to word on click. Could you assist please?

<!DOCTYPE html>

<html lang="el">
    <meta charset="UTF-8">
    <title>Full Name</title>

First Name: <b> {{ $name    }}</b><br>
Last Name: <b> {{ $lastname}}</b><br>


Please sign in or create an account to participate in this conversation.