Repository navigation
Releases: DirectoryTree/Screenshot
Releases · DirectoryTree/Screenshot
Release list
v1.2.0
Added
- A Gotenberg driver for capturing PNG, JPEG, and PDF files through a remote service using the existing fluent API. Thanks @hosmelq! #7
use DirectoryTree\Screenshot\Facades\Screenshot;
Screenshot::driver('gotenberg')
->view('invoices.preview', ['invoice' => $invoice])
->javascript()
->pdf()
->save(storage_path('app/invoice.pdf'));Requires Gotenberg 8.38 or later. The capture's JavaScript setting must match the service. See the Gotenberg documentation for configuration and supported options.
Full Changelog: v1.1.1...v1.2.0
v1.1.1
Added
- Protected
createBrowserFactory()andgetBrowserOptions()methods for customizing Chrome browser creation in custom drivers - #5
v1.1.0
Added
- Support for custom screenshot drivers through
Screenshot::extend()andScreenshot::driver(), with Chrome as the default - #3 - A shared
Contracts\Factoryinterface for typed injection, with a fake that records captures across all drivers - #3 - A0, A1, A2, A6, Tabloid, and Ledger PDF paper sizes - #4
Breaking Changes
- Inject
DirectoryTree\Screenshot\Contracts\Factoryinstead of the concreteScreenshotclass when resolving screenshots through Laravel's container. - Register custom drivers using
Screenshot::extend()instead of replacing theContracts\Driverbinding. Screenshot::fake()now returnsScreenshotManagerFakeinstead ofScreenshotFake. Existing facade capture and assertion calls continue to work.
v1.0.0
The first stable release of Screenshot brings image and PDF capture to PHP and Laravel using Chrome. Node.js and Puppeteer aren't required.
Capture HTML, Blade views, or URLs, then save the result locally or store it on a Laravel filesystem disk:
use DirectoryTree\Screenshot\Facades\Screenshot;
Screenshot::view('invoices.preview', ['invoice' => $invoice])
->element('#invoice')
->pdf()
->save(storage_path('app/invoice.pdf'));- PNG, JPEG, and PDF output with separate image and print settings.
- Full-page, viewport, and element image capture with configurable size limits.
- Element PDFs using the document's print styles, paper settings, and page breaks.
- Shared browsers for parallel workers and a Chrome installer for supported platforms.
- Capture fakes and assertions for Laravel tests.
Element PDFs move the selected content into the document body. Styles that depend on removed parent elements may need adjustment.
Requires PHP 8.2+. Laravel integration supports Laravel 12 and 13, with PHP 8.3+ required for Laravel 13.
composer require directorytree/screenshot:^1.0
php artisan screenshot:installSee the README for configuration and usage.