DEV Community

Cover image for [Laravel 8 PDF] Laravel 8 Generate PDF File using DomPDF- Step by Step
Robert Look
Robert Look

Posted on

[Laravel 8 PDF] Laravel 8 Generate PDF File using DomPDF- Step by Step

PDF is one of the basic requirements when you are working on the eCommerce website. we need to create a pdf file for the invoice etc. So, here I will show you a very simple example to create a pdf file with laravel 8.

In this example, we will install barryvdh/laravel-dompdf composer package, and then we will add a new route with a new controller file. Then we will create one example blade file. Then after you have to just run the project and see the pdf file for download. You need to just follow a few steps and get a basic example of a pdf file.
config/app.php

'providers' => [
    ....
    Barryvdh\DomPDF\ServiceProvider::class,
],

'aliases' => [
    ....
    'PDF' => Barryvdh\DomPDF\Facade::class,
]
Enter fullscreen mode Exit fullscreen mode

Read More: [Laravel 8 PDF] Laravel 8 Generate PDF File using DomPDF- Step by Step

Top comments (0)