Use Spatie’s laravel-screenshot package when your Laravel application needs to capture a URL. Install it with Composer, choose its local Chromium (Browsershot) or Cloudflare Browser Rendering driver, then save a screenshot synchronously or queue it for background processing. The smallest working call is:
use SpatieLaravelScreenshotFacadesScreenshot;
Screenshot::url('https://example.com')->save('screenshot.png');
This guide covers installation, driver selection, output customization, queues, deployment issues, testing, and a hosted alternative when you do not want to maintain a browser runtime.
What the Laravel screenshot package does
Spatie’s Laravel Screenshot package provides a facade-based API that turns a web URL into an image file. Its documented defaults are a 1280×800 viewport, a device scale factor of 2, PNG output, and waiting for network idle before capture. These are capture settings, not speed guarantees.
The package supports two documented drivers:
| Driver | Where the browser runs | Operational consequence |
|---|---|---|
| Browsershot | On your Laravel host or worker, using Chromium | You must install the Browsershot dependencies, Node.js and a compatible Chrome/Chromium runtime, and permit the process to run. |
| Cloudflare | Cloudflare Browser Rendering | Your host does not need Node.js or a Chrome binary, but your application depends on an external service, account configuration, credentials, network access and that service’s limits and pricing. |
The documentation does not establish a complete Laravel/PHP compatibility matrix or current Cloudflare pricing. Check the provider documentation and your installed package version before deployment. Packagist listed release 1.2.0 and a 2026-09-07 update when observed on 2026-09-29; registry metadata can change.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Install the package
- From your Laravel project, run:
composer require spatie/laravel-screenshot - Read the installation and setup documentation for the driver you intend to use.
- For the default Browsershot path, install and verify the Node.js, Chromium/Chrome and Browsershot runtime required by your deployment image. Composer installs the Laravel package; it does not by itself provide every operating-system browser dependency.
- If using Cloudflare, configure the required account and API credentials according to Cloudflare’s current Browser Rendering setup, then select that driver.
Set the default driver with the LARAVEL_SCREENSHOT_DRIVER environment variable or the package configuration file. You can override it for one capture:
Screenshot::url('https://example.com')
->driver('cloudflare')
->save('screenshot.png');
Capture a URL synchronously
Use the facade, provide a fully qualified URL, and call save(). The path is interpreted by the package’s configured storage behavior; use an explicit disk when your application’s setup requires one.
use SpatieLaravelScreenshotFacadesScreenshot;
Screenshot::url('https://example.com')->save('screenshot.png');
save() performs the browser work during the current PHP request. It is appropriate for an administrator action or a short, infrequent capture, but a slow page, JavaScript-heavy site or constrained worker can increase request time. Put longer jobs on a queue instead of allowing a web request to wait indefinitely.
Set dimensions, format and quality
The documented fluent methods let you change the viewport and JPEG quality:
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Clear out junk files and repair common Windows errors3Fix the driver behind crashes, sound loss and screen glitchesuse SpatieLaravelScreenshotFacadesScreenshot;
Screenshot::url('https://example.com')
->width(1920)
->height(1080)
->quality(80)
->save('screenshot.jpg');
Use a .png filename for lossless PNG output or .jpg for JPEG output with a quality value. Choose dimensions that match the consuming interface: a social-card generator, for example, should not use the same viewport as a desktop review image.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
For driver-specific behavior, the package exposes Browsershot customization. The customizing Browsershot documentation shows request headers, a custom user agent, cookies, dialog handling and timeouts. Global settings belong in configuration; one-capture settings can be supplied through withBrowsershot().
Screenshot::url('https://example.com')
->withBrowsershot(function ($browsershot) {
$browsershot
->timeout(120)
->userAgent('MyScreenshotWorker/1.0');
})
->save('screenshot.png');
Use the exact Browsershot methods supported by the version installed in your project. A closure passed to withBrowsershot() is not compatible with queued generation, because the closure cannot reliably be serialized.
Run captures in a queue
For reports, previews or batch work, call saveQueued():
Free tools Windows power users keep installed
One-click scans. No signup required.
Screenshot::url('https://example.com')
->saveQueued('screenshot.png');
The package documents queue, connection and delay configuration, storage-disk handling, and a replaceable job class. Customize that job when you need explicit retry, timeout or backoff policies. A practical production flow is:
- Store a capture record with a pending status and destination path.
- Dispatch
saveQueued()from the request. - Let a worker run the browser job and update the record after the file is written.
- Expose the stored file only after success; mark failures and retain the exception for diagnosis.
Make sure a worker image has the same browser dependencies and environment variables as the web image when using Browsershot. Configure queue timeouts longer than the page’s expected load time, while still applying a finite browser timeout so a broken target cannot occupy a worker forever. See Spatie’s queued-generation documentation for the package’s configuration points.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Browsershot deployment requirements
Local Chromium
Browsershot gives you local control and avoids a per-capture hosted-browser dependency, but the runtime must be present on every machine that executes captures. Confirm Node.js, the Chrome/Chromium binary, required libraries, writable temporary directories and process permissions in your production container or VM.
Sandbox restrictions
In Docker or another restricted environment, the documentation provides a no-sandbox option globally with LARAVEL_SCREENSHOT_NO_SANDBOX=true or per capture with Browsershot’s noSandbox(). Disabling the browser sandbox changes your security posture; use it only when required by the environment and follow your container and deployment security rules.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Cloudflare Browser Rendering
The Cloudflare driver removes Node.js and a local Chrome binary from the Laravel host. It introduces service credentials, outbound network requirements, account configuration and provider limits. Confirm those details directly with Cloudflare before choosing it for a high-volume or regulated workload.
Choose synchronous or queued generation
| Requirement | Use | Why |
|---|---|---|
| User must receive the image immediately | save() |
Simple request-response flow; the request waits for the browser. |
| Page loads can be slow or numerous | saveQueued() |
Moves browser work to a worker and lets the request return quickly. |
| Per-capture Browsershot closure is required | save() |
Queued jobs cannot reliably serialize withBrowsershot() closures. |
| Workers cannot run Chrome | Cloudflare driver | Browser execution is external, subject to service setup and network availability. |
Test screenshot code without opening a browser
The package README demonstrates faking screenshot capture and asserting that a target URL was saved. Keep application tests deterministic by replacing the capture boundary rather than launching Chromium in every test. Assert the URL, destination path and any business state your code should update; reserve a smaller number of integration tests for the actual browser environment.
This is different from Laravel Dusk. Dusk is a browser automation and testing API with browser, responsive and element screenshot methods intended as test artifacts. Laravel Screenshot is the application-capture flow described here.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Troubleshoot common failures
“Chrome/Chromium not found” or process-spawn errors
Cause: the worker image lacks the browser, Node.js, a required shared library or the configured binary path. Fix: install the Browsershot runtime in the same image that executes the job, set the documented binary configuration, and run a capture from that image.
Works locally, fails in Docker
Cause: sandbox, filesystem or library restrictions differ between environments. Fix: inspect container logs and permissions, provide writable temporary and destination paths, and use the documented no-sandbox setting only after reviewing its security implications.
Queued job never completes
Cause: no worker is consuming the configured queue, the worker timeout is too short, or the job is failing and being retried. Fix: verify queue connection and worker status, inspect failed-job records, align queue and browser timeouts, and configure finite retries and backoff.
Page is blank or incomplete
Cause: the target requires authentication, blocks the user agent, depends on late JavaScript, or fails from the worker’s network. Fix: supply documented headers, cookies or a user agent through Browsershot, increase the browser timeout where appropriate, and verify the URL from the worker network. A screenshot tool cannot capture content the browser never successfully loads.
JPEG is unexpectedly large or soft
Cause: dimensions and quality are independent choices. Fix: set an intentional width and height, choose PNG for lossless output, or tune JPEG quality() for the required size/detail balance.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Or skip the browser setup
ScreenshotNeo is a hosted screenshot API and MCP server. It is the first alternative to try when you want a single HTTP call instead of installing Chromium. Before capture it accepts cookie/consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and responses identify the result with X-Page-Verdict and X-Billed headers.
For Laravel, call it from a queued job or service class with your normal HTTP client:
use IlluminateSupportFacadesHttp;
$response = Http::timeout(90)->get(
'https://api.screenshotneo.com/v1/shot',
[
'access_key' => config('services.screenshotneo.key'),
'url' => 'https://example.com',
]
);
$response->throw();
Storage::disk('public')->put('screenshots/example.webp', $response->body());
See the ScreenshotNeo documentation for all parameters. The API supports full-page captures with lazy images loaded, CSS-selector element shots, dark mode, 12 device presets or custom viewports, retina scale, PDF paper settings and page ranges, HTML/CSS-to-image, custom JavaScript and CSS, pre-capture clicks, hidden selectors, selector/delay/network-idle waits, blocked ads or resource types, headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, chosen cache TTLs, signed image links, asynchronous jobs with signed webhooks, 100-URL bulk calls, a usage API and an OpenAPI specification. Common parameter names used by other screenshot APIs also work.
ScreenshotNeo also provides take_screenshot, get_page_info and capture_pdf through its MCP server for Claude, Cursor and other MCP clients. Every plan includes every feature: 1,000 shots per month are free with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.
Cost, reliability and security decisions
- Local driver: budget for maintaining browser binaries, operating-system packages, worker memory and upgrades. It can keep page data inside your infrastructure, subject to your own logging and network controls.
- Hosted driver or API: budget for provider usage and account limits, and design for network or provider errors. Do not place API keys in client-side code; keep them in Laravel secrets.
- Untrusted URLs: restrict who can request captures, validate allowed schemes and consider SSRF protections. A browser worker that can reach internal addresses is a security boundary.
- Output files: use non-guessable names, enforce storage permissions and define retention. Screenshots can contain personal or confidential information.
Quick implementation checklist
- Install
spatie/laravel-screenshotand pin/verify the version used by your deployment. - Choose Browsershot or Cloudflare based on runtime ownership and service dependency.
- Capture a public test URL with
save()before adding application-specific authentication. - Set dimensions and output format explicitly for downstream consumers.
- Move slow or repeated work to
saveQueued(); configure worker timeout, retries and storage. - Never combine
saveQueued()withwithBrowsershot(). - Test the capture boundary with a fake and use Dusk separately for browser-test screenshots.
- Protect URLs, credentials and generated files.
Frequently Asked Questions
Does Laravel Screenshot capture a local Laravel route?
Yes, provided the browser can reach the route. For a protected or non-public route, supply the required authentication headers or cookies through the configured Browsershot options, or expose the route only to a controlled capture worker.
Can I use the package to create PDFs?
The documented package material here focuses on image screenshots. Use a PDF-capable workflow when the required output is a PDF, and verify the current package documentation for any supported PDF method.
Which driver should a small team start with?
Start with Browsershot if your deployment already supports Node.js and Chromium. Choose Cloudflare when maintaining those binaries is impractical and an external browser service fits your security and operational requirements.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →

