How to Capture a Laravel App in PHP

How to Capture a Laravel App in PHP

author

Snapshot Site Team

31 Dec 2025 - 02 Mins read

Laravel applications range from plain Blade-rendered pages to Livewire-driven dashboards with reactive updates, and screenshotting them reliably means accounting for both. A Laravel backend is also a natural place to trigger the capture from, since the same PHP codebase that serves the app can call the screenshot API directly.

Why Laravel Apps Need a Little Care

  • Livewire components update reactively after the initial page load, similar to any client-side framework — a capture taken too early can miss the settled state.
  • Blade-rendered dashboards are often long, table- and card-heavy pages where a full-page capture matters more than a cropped viewport.
  • Session-based auth means authenticated screens need the same session-valid URL approach as any other login-protected app.

PHP Example

<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://api.prod.ss.snapshot-site.com/api/v1/screenshot",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "x-snapshotsiteapi-key: YOUR_API_KEY"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "url" => "https://app.example.com/dashboard",
        "format" => "png",
        "width" => 1440,
        "height" => 900,
        "fullSize" => true,
        "hideCookie" => true,
        "delay" => 2
    ])
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;

delay covers the gap between a Livewire component mounting and its first reactive update arriving — without it, a capture risks catching the pre-update state of the page.

Practical Recommendations

  • Use delay on any Livewire-heavy screen. A short delay (1-2 seconds) is usually enough to let components settle.
  • Default to fullSize: true for dashboards and reports. Laravel admin panels built with packages like Filament or Nova are frequently long, scrollable pages.
  • Point captures at authenticated session URLs for anything behind Laravel's session guard, the same pattern as any other login-protected screen.
  • Strip environment banners with hide. Staging ribbons common in Laravel deployments (Envoyer, Forge previews) can be removed cleanly on the v2 endpoint.

Common Use Cases

  • Visual QA before deploying a Blade or Livewire template change
  • Weekly dashboard snapshots for stakeholders without direct system access
  • Documentation screenshots for internal admin panels
  • Feeding a scheduled visual monitor, as described in Visual Uptime Monitoring

For teams already comfortable in PHP, Snapshot Site turns Laravel screenshotting into one more API call in the existing stack, not a separate service to run.

Related Laravel capture resources

Compare the PHP SDK, Symfony integration, screenshot API authentication, error handling, and pricing.

Start a free server-side capture with one authorized Laravel route.

Frequently asked questions

Where should Laravel call Snapshot Site?

Use a service or queued job on the server. Keep the API key in protected configuration and avoid calls from Blade or public JavaScript.

Should screenshot jobs use Laravel queues?

Queues are useful for variable latency, batches, retry, scheduling, and work that should survive an HTTP request.

How do I capture Livewire content?

Wait until the required Livewire state and related network data have settled, using a representative fixture and measured readiness.

Can a private Laravel route be captured?

Use a short-lived signed preview designed for the artifact, or use browser automation when an interactive login is truly required.

How should retries be configured?

Retry only transient failures with delay, jitter, a cap, and idempotent storage. Validation and authentication errors need correction.

What context should the model store?

Keep route or domain entity, viewport, format, readiness settings, deployment identity, capture time, status, and asset location.

Related Articles

How to Screenshot a WordPress Site in PHP

How to Screenshot a WordPress Site in PHP

Capture WordPress pages from secure PHP jobs for publishing QA and archives. Handle builders, lazy content, consent UI, caching, and full-page output....

- 02 Mins read

How to Screenshot a Shopify Storefront in PHP

How to Screenshot a Shopify Storefront in PHP

Capture Shopify storefronts from secure PHP jobs for merchandising review and visual QA. Preserve products, locales, responsive states, and release context....

- 02 Mins read

How to Screenshot a HubSpot CMS Landing Page in PHP

How to Screenshot a HubSpot CMS Landing Page in PHP

A practical guide to capturing HubSpot CMS landing and campaign pages from PHP, including handling smart content, cookie banners, and full-page marketing captures....

- 02 Mins read

How to Screenshot a Magento Storefront in PHP

How to Screenshot a Magento Storefront in PHP

A practical guide to capturing Magento storefront pages from PHP, including handling layered navigation, product galleries, and full-page category listings....

- 02 Mins read

Subscribe to Snapshot Site API

Snapshot Site is a powerful API that allows you to capture full-page, high-resolution screenshots of any website with pixel-perfect accuracy.
Simply send a URL to the API to generate a complete snapshot — not just the visible area — covering entire web pages, scrolling content, landing pages, blogs, news articles, social media posts, videos, and more.
Designed for developers, designers, marketers, and journalists,
Snapshot Site makes it easy to integrate web page capture into your applications, workflows, and automation tools.

Subscribe Now
bg wave