spatie/laravel-og-image
Generate Open Graph images for your Laravel app by defining OG image HTML inline in Blade views. The package screenshots them, serves them via a dedicated route, and caches them on disk, inheriting your existing CSS, fonts, and Vite assets.
Architecture fit
<x-og-image>) emits a hidden <template data-og-image> plus the <meta> tags, and auto-registered middleware injects it into HTML responses. This is a natural fit for a Blade + Vite monolith; it is a poor fit for a headless API or SPA-only frontend where server-rendered HTML is not the delivery mechanism./og-image/{md5}.jpeg) served from the public disk with cache headers is the correct architecture for CDN offload; the design assumes a CDN in front.spatie/laravel-screenshot → Browsershot → Node.js + a Chrome/Chromium binary. This effectively makes a headless browser a production runtime dependency of the web tier.Integration feasibility
composer require, optional config publish, one component in the layout or per view, middleware auto-registered. A senior Laravel developer can reach a working spike in under a day.url parameter on the component) allows static or externally hosted images for pages where runtime generation is undesirable — this de-risks partial adoption.Technical risk
->original.{{ }} or @each are a template-injection/XSS-adjacent surface if any part of the OG template is user-authored.Key questions
Stack fit
<template> injection will never reach the crawler and those routes need the url parameter with a pre-built image.Migration path
spatie/browsershot calls in a controller, (b) Intervention/Imagick compositing with a static background, (c) a third-party OG service (Cloudinary, Vercel OG, Bannerbear).url parameter makes partial migration clean — untemplated pages can keep their existing static asset while templated pages move to generation.Compatibility
?ogimage) and the fixed query-parameter handling in 1.3.1 mean query-string caching rules must be deliberate.</body>.Sequencing
Maintenance
^1.3). The cadence between 1.0.0 and 1.3.2 was fast and included behavioral fixes to middleware and caching; the 1.1.3/1.1.4 misnumbering means a loose constraint can silently resolve to a tag the maintainers did not intend.Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?