motekar/laravel-pdf
Larablocks Analysis
motekar/laravel-pdf works with Laravel 10, 11 and 12 (latest release v1.1.0, Mar 14, 2025).
Recommendation checks
Use with careUse with care: meets 0 of 4 checks.
- Latest release doesn't support Laravel 13, the current version
- No release in the last 12 months (last: Mar 14, 2025)
- 5 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Quiet- Last stable release: Mar 14, 2025.
- No releases in the last 12 months.
- First released: Oct 9, 2024.
- Monthly downloads: 5, down 86% from six months ago.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require motekar/laravel-pdf |
|
| Latest Version: | v1.1.0 |
| PHP: | ^8.2 |
| Laravel: | 10 · 11 · 12 |
| License: | MIT |
| Last Updated: | Mar 14, 2025 |
| Links: | GitHub · Packagist |
Create PDFs in Laravel apps
This package provides a simple way to create PDFs in Laravel apps. Under the hood it uses Chromium to generate PDFs from Blade views. You can use modern CSS features like grid and flexbox to create beautiful PDFs.
Unlike spatie/laravel-pdf this package does not require nodejs and puppeteer, it uses chrome-php/chrome instead.
Here's a quick example:
use Motekar\LaravelPdf\Facades\Pdf;
Pdf::view('pdfs.invoice', ['invoice' => $invoice])
->format('a4')
->save('invoice.pdf')
This will render the Blade view pdfs.invoice with the given data and save it as a PDF file.
You can also return the PDF as a response from your controller:
use Motekar\LaravelPdf\Facades\Pdf;
class DownloadInvoiceController
{
public function __invoke(Invoice $invoice)
{
return Pdf::view('pdfs.invoice', ['invoice' => $invoice])
->format('a4')
->name('your-invoice.pdf');
}
}
You can use also test your PDFs:
use Motekar\LaravelPdf\Facades\Pdf;
it('can render an invoice', function () {
Pdf::fake();
$invoice = Invoice::factory()->create();
$this->get(route('download-invoice', $invoice))
->assertOk();
Pdf::assertRespondedWithPdf(function (PdfBuilder $pdf) {
return $pdf->contains('test');
});
});
Documentation
Installation
You can install the package via composer:
composer require motekar/laravel-pdf
Under the hood this package uses Google Chrome or Chromium to generate PDFs. You'll need to install any of these browsers on your system.
Usage
This package supports almost every feature of Spatie's Laravel PDF package. For detailed usage documentation, we recommend referring to the comprehensive guide available on Spatie's documentation site. The usage patterns and methods are largely compatible, allowing you to leverage the extensive documentation provided by Spatie for this package as well.
Testing
For running the testsuite, you'll need the pdftotext CLI which is part of the poppler-utils package. More info can be found in in the spatie/pdf-to-text readme. Usually brew install poppler will suffice.
Finally run the tests with:
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.
Related Packages
Build Elasticsearch queries based of a query string
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v1.1.0 | ^8.2 | ^10.0| | MIT | |
| v1.0.6 | ^8.2 | ^10.0| | MIT | |
| v1.0.5 | ^8.2 | ^10.0| | MIT | |
| v1.0.4 | ^8.2 | ^10.0| | MIT | |
| v1.0.3 | ^8.2 | ^10.0| | MIT | |
| v1.0.2 | ^8.2 | ^10.0| | MIT | |
| v1.0.1 | ^8.2 | ^10.0| | MIT | |
| v1.0.0 | ^8.2 | ^10.0| | MIT |