PHPackages                             paulund/og-image-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. paulund/og-image-generator

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

paulund/og-image-generator
==========================

Laravel OG Image Generator

2.1.0(11mo ago)71.6k1[3 PRs](https://github.com/paulund/og-image-generator/pulls)1PHPPHP ^8.3CI passing

Since Sep 20Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/paulund/og-image-generator)[ Packagist](https://packagist.org/packages/paulund/og-image-generator)[ GitHub Sponsors](https://github.com/paulund)[ RSS](/packages/paulund-og-image-generator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (11)Versions (11)Used By (1)

OG Image Generator
==================

[](#og-image-generator)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f6eacf63e7e16fd23019b4d8d244452843e8bd3eb4e817fccc6f2e5155c68105/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061756c756e642f6f672d696d6167652d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paulund/og-image-generator)[![GitHub Tests Action Status](https://camo.githubusercontent.com/32299d2c470a5fda0343fe3d5100d3d30f6c3570b7cbb7990c22b40bfb8dc2fe/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061756c756e642f6f672d696d6167652d67656e657261746f722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/paulund/og-image-generator/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/bc8136acdca6d8857d2aa026104733b3c4b8e17884a25e88cc79b88104be222f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7061756c756e642f6f672d696d6167652d67656e657261746f722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/paulund/og-image-generator/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/7471aa2a3e5a605dd499ccb728458d1c94942211b39b2058f7b2ed8e8dbe4da5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7061756c756e642f6f672d696d6167652d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paulund/og-image-generator)

---

[![OG Image Generator Laravel Package](https://raw.githubusercontent.com/paulund/og-image-generator/refs/heads/main/assets/images/og-image-generator.webp)](https://raw.githubusercontent.com/paulund/og-image-generator/refs/heads/main/assets/images/og-image-generator.webp)

Laravel package to automatically create a og image that the page generates when it's saved to social media.

Table Of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Configuration](#configuration)
- [Delete Old Images](#delete-old-images)
- [Testing](#testing)
- [Credits](#credits)
- [License](#license)
- [Tutorial](#tutorial)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require paulund/og-image-generator
npm install puppeteer
php artisan vendor:publish --provider="Paulund\OgImageGenerator\OgImageGeneratorServiceProvider"
```

In the `` tag of your application you need to add the meta og-image tag. Pointing to the route created by the package and passing in a variable of `$ogTitle` which is the text that will appear on the generated image.

```

```

Configuration
-------------

[](#configuration)

There is no configuration required for this package. The package will automatically start generating Open Graph images for social media sharing.

But you can configure the package by publishing the config file, which will allow you to change the following configs.

- Image mime type - default is png
- Storage disk - default is local
- Storage path - default is public/og-images
- Extra data - you can add extra data to the image that will be passed to the view

### Config Styling

[](#config-styling)

By default OG Image Generator comes with tailwinds css installed on the page and you can customise the styling of the image by changing the tailwind classes in the config file.

```
'styling' => [
    'background' => 'bg-gray-900',
    'text' => 'text-white',
],
```

Customise The View
------------------

[](#customise-the-view)

If you'd like you use your own blade view file then you can change the view config in the config file.

```
'view' => env('OG_IMAGE_GENERATOR_VIEW', 'paulund/og-image-generator::image'),
```

Or you can change the view in the `.env` file.

```
OG_IMAGE_GENERATOR_VIEW=your-view-file
```

Extra Data
----------

[](#extra-data)

If you want to pass extra data to the view then you can add it to the config file.

```
'extra' => [
    'logo'
    'author'
],
```

When this is passed into the request it will be available in the view as `$extra['logo']` and `$extra['author']`.

Delete Old Images
-----------------

[](#delete-old-images)

There is a command that you can run to delete all the old images that have been created by the package.

```
php artisan og-image:delete-old-images
```

This command will delete all the images that are older than 90 days.

This command is added to the Laravel scheduler to run every day.

Testing
-------

[](#testing)

```
vendor/bin/testbench workbench:install
composer check
```

Credits
-------

[](#credits)

- [paulund](https://paulund.co.uk)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Tutorial
--------

[](#tutorial)

To learn more about how this work you can read the tutorial on [Paulund](https://paulund.co.uk/auto-generate-open-graph-images-laravel)

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance65

Regular maintenance activity

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 72.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~42 days

Recently: every ~56 days

Total

7

Last Release

353d ago

Major Versions

1.3.0 → 2.0.02025-03-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1306197?v=4)[Paulund](/maintainers/paulund)[@paulund](https://github.com/paulund)

---

Top Contributors

[![paulund](https://avatars.githubusercontent.com/u/1306197?v=4)](https://github.com/paulund "paulund (29 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")

---

Tags

generatorlaravelpackagesocial-medialaravelpackagemetaogPaulund

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/paulund-og-image-generator/health.svg)

```
[![Health](https://phpackages.com/badges/paulund-og-image-generator/health.svg)](https://phpackages.com/packages/paulund-og-image-generator)
```

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

74310.9M66](/packages/laravel-mcp)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
