Download the PHP package mischasigtermans/laravel-ogkit without Composer
On this page you can find all versions of the php package mischasigtermans/laravel-ogkit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mischasigtermans/laravel-ogkit
More information about mischasigtermans/laravel-ogkit
Files in mischasigtermans/laravel-ogkit
Package laravel-ogkit
Short Description Dynamic OG images for Laravel. Design social previews with your own HTML and CSS.
License MIT
Informations about the package laravel-ogkit
Laravel OG Kit
Dynamic OG images for Laravel. Design social previews with HTML and CSS using OG Kit.
OG Kit screenshots your custom HTML templates to generate beautiful Open Graph images. This package provides Blade components, directives, and 21 pre-built templates to get you started quickly.
Installation
Add your API key to .env:
Quick Start
Option 1: From Controller/Component (Recommended)
Set the OG template from your controller or Livewire component:
In Livewire:
Option 2: In Blade View
Add a template directly in your Blade view:
Add Meta Tags
Add the meta-tags to your layout's <head>:
Why OG Kit?
Static OG images are limiting. You want dynamic images that reflect your content – blog titles, product names, user profiles. OG Kit lets you design OG images with tools you already know: HTML, CSS, and Tailwind.
How it works:
- Add a template to your page (via controller or Blade)
- OG Kit's service screenshots that template at 1200x630
- The screenshot URL is used as your
og:image
No image generation code. No Puppeteer servers. No Canvas APIs. Just HTML.
Common use cases:
- Blog posts: Dynamic titles with featured images and reading time
- E-commerce: Product images with prices and sale badges
- User profiles: Personalized cards with avatars and stats
- Documentation: Section titles with code snippets
- Social sharing: Year-in-review cards, achievement badges
Preview Mode
Enable the preview overlay during development to see your OG images in real-time:
A preview button is automatically injected into all HTML responses. Click "OG Preview" to see exactly what will be screenshotted.
Templates
22 pre-built templates included:
| Template | Fields | Best For |
|---|---|---|
split-title |
title, subtitle | Landing pages |
image |
title, image | Blog posts |
headline |
title, logo | Announcements |
bold |
title, domain | Simple pages |
bold-logo |
title, logo | Brand pages |
masked |
title, cta | Marketing |
masked-logo |
title, logo, cta | Campaigns |
outlined |
title, domain | Minimal style |
centered |
title, subtitle, domain | About pages |
centered-logo-avatar |
title, logo, authorName, authorImage, image | Author posts |
poppin |
title, domain | Bold statements |
simple |
title, subtitle, domain | General use |
simple-logo |
title, subtitle, logo | Brand pages |
detailed |
title, readingTime, category, image, domain | Blog posts |
wireframe |
title, subtitle, domain | Minimal pages |
wireframe-background |
title, image, domain | Tech content |
wireframe-split |
title, description, image, domain | Articles |
layered |
title, category, image, domain | Featured content |
default |
title, subtitle, price, fromPrice, image | E-commerce |
bold-sale |
title, price, fromPrice, image | Sales |
documentation |
overline, title, subtitle, repository, image | Docs |
repository |
title, subtitle, image, code | Open source |
Using Templates
From controller:
Or in Blade:
If you've set a default template in your config, you can omit the template prop:
Custom Templates
Create your own design without using a named template:
Styling
Color Props
| Prop | CSS Variable | Description |
|---|---|---|
background-primary |
--og-background-primary-color |
Main background |
background-secondary |
--og-background-secondary-color |
Gradient/pattern secondary |
foreground-primary |
--og-foreground-primary-color |
Main text color |
foreground-secondary |
--og-foreground-secondary-color |
Muted text color |
accent-color |
--og-accent-color |
Accent/highlight color |
CSS Utilities
Use these classes in your templates:
Background Types
Set via background-type prop:
| Type | Description |
|---|---|
gradient-vertical |
Top to bottom gradient |
gradient-horizontal |
Left to right gradient |
gradient-diagonal |
Corner to corner gradient |
boxes |
Grid pattern |
paper |
Graph paper pattern |
lines |
Horizontal lines |
lines-v2 |
Vertical lines |
lines-v3 |
Cross-hatch lines |
diagonal |
Diagonal stripes |
diagonal-v2 |
Reverse diagonal stripes |
diagonal-v3 |
Fine diagonal lines |
waves |
Radial wave pattern |
zig-zag |
Zig-zag pattern |
moons |
Moon/circle pattern |
triangles |
Triangle pattern |
triangles-v2 |
Reverse triangles |
rectangles |
Rectangle pattern |
plusses |
Plus sign pattern |
Fonts
Pass any Google Font name:
You can also set a secondary font for accent text like domains or labels:
Use the .og-font-secondary utility class in your custom templates to apply the secondary font.
Configuration
Publish the config file:
Blade Directives
@ogkit
Output complete OG meta tags:
With title and description:
Generates:
@ogkitUrl
Get just the image URL:
With a version parameter for cache busting:
@ogkitTemplate / @endOgkitTemplate
Create inline custom templates:
Service Methods
Tailwind Setup
Add the package views to your tailwind.config.js content array:
Publish and import the CSS utilities:
Or import directly from vendor:
Use Cases
Blog with Dynamic OG Images
E-commerce Product Pages
User Profile Cards
Documentation Pages
Testing
Requirements
- PHP 8.2+
- Laravel 10, 11, or 12
- OG Kit API key
Credits
License
The MIT License (MIT). Please see License File for more information.