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.

Recent Articles

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