Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsFor a Laravel app, the practical choices are Spatie’s laravel-screenshot package using its default local Browsershot driver, the same package using its Cloudflare driver, or a direct call to Cloudflare Browser Rendering. The current Spatie requirements specify PHP 8.4+ and Laravel 12+, so check your app’s versions first. The integration steps below are generic; the cited documentation does not establish India-specific pricing, taxes, service eligibility, data residency, capture location, or latency.
Choose the capture route that fits your app
| Route | What runs the browser | What you need | Best fit |
|---|---|---|---|
| Spatie package with Browsershot | Chromium on your Laravel server | Compatible PHP and Laravel, plus Node.js and Chrome/Chromium | You want a Laravel facade and control of the capture runtime. |
| Spatie package with Cloudflare | Cloudflare Browser Rendering | Compatible PHP and Laravel, Cloudflare account, Browser Rendering enabled, account ID and API token | You want Spatie’s Laravel interface without installing a browser runtime on the app server. |
| Direct Cloudflare API | Cloudflare Browser Rendering | Cloudflare account, Browser Rendering Write permission, account ID and API token | You want to manage Cloudflare request options and response handling directly. |
Spatie describes its package as a way to take screenshots of web pages in Laravel apps. Its documentation presents Browsershot as the default driver and Cloudflare as an alternative. Spatie Laravel Screenshot introduction · Requirements
As an Amazon Associate I earn from qualifying purchases.
Check Laravel and PHP compatibility first
The current Spatie Laravel Screenshot requirements page lists PHP 8.4 or newer and Laravel 12 or newer. Confirm your app meets both requirements before using the package route; if it does not, check the package’s current requirements and compatible release before proceeding. Spatie requirements
Recommended Free Tools
Route 1: Take a screenshot with Spatie and Browsershot
Install the package and browser dependencies
- Install the package with Composer:
composer require spatie/laravel-screenshot. - Install Node.js and a Chrome or Chromium binary in the environment where screenshots will run. Composer installs the Laravel package, not those browser-runtime dependencies.
- If the binaries are not found automatically, configure the paths using the package’s supported environment settings, such as
LARAVEL_SCREENSHOT_CHROME_PATH,LARAVEL_SCREENSHOT_NODE_BINARYandLARAVEL_SCREENSHOT_NPM_BINARY.
See Spatie installation and setup and its requirements for the package’s setup details.
#1 Best Overall
Capture and save a page
The basic facade call saves a screenshot to a path writable by the Laravel process:
<?php
use SpatieLaravelScreenshotFacadesScreenshot;
Screenshot::url('https://example.com')->save('screenshot.png');
The documented defaults are a 1280 × 800 viewport, device scale factor 2, PNG output, and a networkidle2 wait. Set dimensions and quality when you need a different output:
Screenshot::url('https://example.com')
->width(1920)
->height(1080)
->quality(80)
->save('screenshot.jpg');
For full-page capture, clipping, output formats and device-scale controls with Browsershot, consult Browsershot image generation. These documented defaults and controls are configuration details, not performance guarantees.
Route 2: Use Spatie’s Cloudflare driver
This route keeps the Laravel facade but sends the capture to Cloudflare Browser Rendering, so the Laravel server does not need Node.js or a Chrome binary. It does require a Cloudflare account with Browser Rendering enabled, an account ID, and an API token with the required Browser Rendering permission.
Configure credentials on the server
Set the driver and credentials in the server-side environment:
LARAVEL_SCREENSHOT_DRIVER=cloudflare
CLOUDFLARE_API_TOKEN=your-api-token
CLOUDFLARE_ACCOUNT_ID=your-account-id
Keep the token in server-side configuration; do not send it to browser clients. Follow Spatie’s installation and setup instructions for configuring the driver.
Rank #3
Select Cloudflare for a capture
You can set Cloudflare as the default driver with the environment setting above, or select it for an individual capture through the package configuration’s driver('cloudflare') call. The configuration documentation describes the driver selection options: Spatie driver configuration.
Route 3: Call Cloudflare Browser Rendering directly
Cloudflare’s screenshot endpoint is POST https://api.cloudflare.com/client/v4/accounts/{account_id}/browser-rendering/screenshot. It accepts URL or HTML input and options including viewport, full-page capture, output type and quality, selectors, clipping, and page-wait settings. Authenticate with a Bearer API token that has Browser Rendering Write permission. Cloudflare screenshot endpoint
Laravel HTTP-client example
Store the account ID and token in server-side configuration, then send the request as JSON. This example shows the documented request shape; adapt configuration names and response handling to your app:
Rank #4
<?php
use IlluminateSupportFacadesHttp;
$accountId = config('services.cloudflare.account_id');
$url = 'https://example.com';
$response = Http::withToken(config('services.cloudflare.browser_rendering_token'))
->acceptJson()
->post("https://api.cloudflare.com/client/v4/accounts/{$accountId}/browser-rendering/screenshot", [
'url' => $url,
'screenshotOptions' => [
'type' => 'png',
'fullPage' => true,
'viewport' => ['width' => 1280, 'height' => 800],
],
]);
$data = $response->json();
if (! $response->successful() || ! ($data['success'] ?? false)) {
throw new RuntimeException('Cloudflare screenshot request failed: '.json_encode($data['errors'] ?? []));
}
// Handle the successful response according to the requested output encoding.
Check both the HTTP status and Cloudflare’s success and errors fields before treating the capture as successful. The endpoint documentation includes a rate-limit error example, so handle failures rather than assuming every request returns an image. The exact response processing depends on the selected output encoding and documented response format. If you need page HTML and a screenshot together, Cloudflare has a separate snapshot endpoint: Cloudflare snapshot endpoint.
Run captures reliably in a Laravel application
Choose synchronous or queued work
A capture can take long enough that an HTTP request should not wait for it. Spatie supports saveQueued() and queue, connection, delay, and custom-job settings. Its queued-generation documentation says saveQueued() cannot be combined with withBrowsershot(); check that constraint when configuring queued captures. Spatie queued screenshot generation
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Plan for runtime and API failures
- For Browsershot, verify Node.js and Chrome/Chromium are installed in the actual worker or server environment, and that configured binary paths are valid.
- For Cloudflare, verify the account ID, token, permission and Browser Rendering enablement. Keep credentials out of client-side code and logs.
- For direct API calls, inspect both transport-level status and Cloudflare’s JSON success/error fields. Handle rate-limit responses and other failures in the application.
- Write output only to a path the Laravel process can access, and make the application’s response or job status distinguish a failed capture from a completed one.
India-specific considerations
The integration instructions above are not specific to India. The cited documentation does not establish whether a particular Cloudflare account or feature is available to every Indian user, what local taxes or prices apply, where a capture is processed, or what latency an app in India will experience. Confirm current account eligibility and commercial terms with the relevant provider, and measure latency from your own deployment region before making a regional design decision.
Best Value
Or skip the browser setup
ScreenshotNeo is a screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP or PDF, without installing Node.js or Chromium in your Laravel environment. Cookie banners are accepted and removed before capture, along with known consent platforms, newsletter popups and chat widgets; these cleanup steps can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. AI agents can use its MCP server tools, including take_screenshot, get_page_info and capture_pdf.
For example, use Laravel’s HTTP client to make the API GET request and save its response:
<?php
use IlluminateSupportFacadesHttp;
$response = Http::get('https://api.screenshotneo.com/v1/shot', [
'access_key' => config('services.screenshotneo.access_key'),
'url' => 'https://example.com',
]);
$response->throw();
file_put_contents(storage_path('app/screenshot.webp'), $response->body());
See the ScreenshotNeo documentation for the API options and response details. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up free for 1,000 screenshots a month, with no card required.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Frequently Asked Questions
Can I use the Cloudflare route without installing Node.js on my Laravel server?
Yes. Spatie’s Cloudflare driver and the direct Cloudflare API route use Cloudflare Browser Rendering rather than a local Node.js and Chrome/Chromium runtime.
Can the direct Cloudflare endpoint capture HTML instead of a URL?
The screenshot endpoint documentation lists URL or HTML input. Use its documented request fields for the input type and options you need.
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.




