Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Og Image Laravel Package

spatie/laravel-og-image

Generate Open Graph images in Laravel from Blade-defined HTML. Automatically renders screenshots, serves them from a route, and caches files. Templates reuse your app’s CSS, fonts, and Vite assets—no external API required.

View on GitHub
Deep Wiki
Context7

title: Customizing the screenshot layout weight: 5

When you visit a page with ?ogimage, the package renders a minimal HTML document that wraps your template content. This document includes the page's <head> (so CSS and fonts work) and a reset style that sets the viewport to the configured dimensions.

If you need to customize this layout (for example, to add extra styles, scripts, or change the document structure), you can publish the view:

php artisan vendor:publish --tag=og-image-views

This publishes screenshot.blade.php to resources/views/vendor/og-image/. The view receives these variables:

$head

The contents of the original page's <head> tag, including all CSS, fonts, and Vite assets.

$templateContent

The HTML from your <x-og-image> component.

$width

The configured width in pixels (default: 1200).

$height

The configured height in pixels (default: 630).

For even deeper control over how the screenshot page is rendered, you can override the RenderOgImageScreenshotAction. See customizing actions for details.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai