See rates for the top Laravel developers in Latin America

Generate awesome open graph images with Open Graphy

Last updated on by

Generate awesome open graph images with Open Graphy image

The Open Graph protocol, initially introduced by Facebook in 2010, is a set of technologies that allows web developers to control how their web pages are represented when shared on social media platforms. By enabling your pages to become "rich" objects in a social graph, Open Graph meta tags dictate the title, description, image, and other vital information that appears in social media previews. This is where Open Graphy steps in: it's a neat Laravel package designed to generate these essential Open Graph images for your application dynamically. Open Graphy helps you to create social cards on the fly, either leveraging its intuitive default templates or allowing you to create your own, ensuring your content always makes a striking impression across social networks.

Main Features

  • Easily generate open graph images for your website.
  • Add a title, an image, and your logo to the Open Graph image.
  • Add a screenshot of the page inside the open graph image to show the preview of the page.
  • 5 different default templates to choose from, stripes, nodes, sunny, verticals and strings.
  • Customize the colours and styles of the templates.
  • Cache the generated images.
  • Create your own template if you want.

Note: Open Graphy requires the Chrome or Chromium browser to be installed on your server to render the images. The README file provides instructions on how to install this on Ubuntu/Debian and MacOS.

Assuming you already have Chrome or Chromium installed, you can then install this package using Composer:

composer require saasykit/laravel-open-graphy

You can also publish the config so you can customize further:

php artisan vendor:publish --tag="open-graphy-config"

Finally, you add the following component to your Blade template in the <head></head> tags:

<x-open-graphy::links title="Laravel News Open Graphy Demo" template="sunny" />

This will output the following:

<meta property="og:image" content="{URL}">
<meta property="og:image:type" content="image/png">
<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="{URL}">

Here is a sample of an Open Graph image generated using Open Graphy with the sunny template and the Laravel News logo:

Learn more about this package and view the source code on GitHub.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.

image
Bacancy

Outsource a dedicated Laravel developer for $3,200/month. With over a decade of experience in Laravel development, we deliver fast, high-quality, and cost-effective solutions at affordable rates.

Visit Bacancy
Curotec logo

Curotec

World class Laravel experts with GenAI dev skills. LATAM-based, embedded engineers that ship fast, communicate clearly, and elevate your product. No bloat, no BS.

Curotec
Bacancy logo

Bacancy

Supercharge your project with a seasoned Laravel developer with 4-6 years of experience for just $3200/month. Get 160 hours of dedicated expertise & a risk-free 15-day trial. Schedule a call now!

Bacancy
Tinkerwell logo

Tinkerwell

The must-have code runner for Laravel developers. Tinker with AI, autocompletion and instant feedback on local and production environments.

Tinkerwell
Cut PHP Code Review Time & Bugs into Half with CodeRabbit logo

Cut PHP Code Review Time & Bugs into Half with CodeRabbit

CodeRabbit is an AI-powered code review tool that specializes in PHP and Laravel, running PHPStan and offering automated PR analysis, security checks, and custom review features while remaining free for open-source projects.

Cut PHP Code Review Time & Bugs into Half with CodeRabbit
Get expert guidance in a few days with a Laravel code review logo

Get expert guidance in a few days with a Laravel code review

Expert code review! Get clear, practical feedback from two Laravel devs with 10+ years of experience helping teams build better apps.

Get expert guidance in a few days with a Laravel code review
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing
Lucky Media logo

Lucky Media

Get Lucky Now - the ideal choice for Laravel Development, with over a decade of experience!

Lucky Media
Lunar: Laravel E-Commerce logo

Lunar: Laravel E-Commerce

E-Commerce for Laravel. An open-source package that brings the power of modern headless e-commerce functionality to Laravel.

Lunar: Laravel E-Commerce
SaaSykit: Laravel SaaS Starter Kit logo

SaaSykit: Laravel SaaS Starter Kit

SaaSykit is a Multi-tenant Laravel SaaS Starter Kit that comes with all features required to run a modern SaaS. Payments, Beautiful Checkout, Admin Panel, User dashboard, Auth, Ready Components, Stats, Blog, Docs and more.

SaaSykit: Laravel SaaS Starter Kit

The latest

View all →
JSON:API Resource in Laravel 12.45 image

JSON:API Resource in Laravel 12.45

Read article
Caching With MongoDB for Faster Laravel Apps image

Caching With MongoDB for Faster Laravel Apps

Read article
Laravel 12.44 Adds HTTP Client afterResponse() Callbacks image

Laravel 12.44 Adds HTTP Client afterResponse() Callbacks

Read article
Handle Nested Data Structures in PHP with the Data Block Package image

Handle Nested Data Structures in PHP with the Data Block Package

Read article
Detect and Clean Up Unchanged Vendor Files with Laravel Vendor Cleanup image

Detect and Clean Up Unchanged Vendor Files with Laravel Vendor Cleanup

Read article
Seamless PropelAuth Integration in Laravel with Earhart image

Seamless PropelAuth Integration in Laravel with Earhart

Read article