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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport