Hello Devs,

In this tutorial, we are going to learn how to generate laravel 7 word document from HTML.

Given below is the full example to generate word document file.

Create Route: routes/web.php


Route::get('docs-generate', function(){

    $headers = array(





    $content = '<html>

            <head><meta charset="utf-8"></head>


                <p>My Blog Laravel 7 generate word document from html Example - Rathorji.in</p>





    return \Response::make($content,200, $headers);


I hope this example helps you.