Add dynamic social card images to every Laravel route. Works with Blade, Inertia, and Livewire.
Get StartedPure PHP implementation with no external dependencies or framework-specific quirks.
Pass ogUrl to your Blade templates with compact() or with() for clean integration.
Use Laravel's config system to store your Imago API key securely.
<?php
// app/Http/Controllers/PostController.php
public function show(Post $post)
{
$ogUrl = 'https://imagoapi.com/api/og/generate?' . http_build_query([
'title' => $post->title,
'template' => 'modern',
'api_key' => config('services.imago.key'),
]);
return view('posts.show', compact('post', 'ogUrl'));
}
<!-- resources/views/posts/show.blade.php -->
<meta property="og:image" content="{{ $ogUrl }}">
<meta name="twitter:image" content="{{ $ogUrl }}">
Join thousands of developers using Imago API for dynamic social cards.
Start Free Trial