PHP web framework
Add automatic MyOG.social images to Laravel Blade layouts with request URL helpers and page-specific meta sections.
Laravel Blade layouts are a good MyOG integration point because they render server-side head tags before social crawlers fetch the page.
Use url()->current() for the current public page URL, or pass a canonical URL from the controller when the route should ignore query parameters or aliases.
Sections and stacks let individual pages override or extend the shared metadata without duplicating the whole layout.
MyOG detects page content and branding automatically. The layout only controls image composition.
Use this in your layout head or shared SEO component.
@php
$pageUrl = $canonicalUrl ?? url()->current();
$myogImageUrl = "https://api.myog.social/og?url=" . rawurlencode($pageUrl) . "&template=screenshot-right";
@endphp
<meta property="og:image" content="{{ $myogImageUrl }}" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="{{ $myogImageUrl }}" />Set $canonicalUrl in a controller or view when the request URL is not the URL you want crawlers to share.
Laravel apps often use SEO packages or custom Blade components that already render og:image. Replace the image value there or skip the fallback when a page-specific image section is present.
Use controller data for posts, products, and localized pages when canonical URLs need route helpers. url()->current() is fine for straightforward public routes.
Start with the MyOG Open Graph Checker, then refresh social platform caches if needed.
Sign up for free and add generated social images to Laravel pages.
Already have an account?
cdf733b534ea2f2ed964d150330b323c44837e4f