PHPackages                             sokil/php-social-opengraph - 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. sokil/php-social-opengraph

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

sokil/php-social-opengraph
==========================

lib to work with OpenGraph

1.0.1(8y ago)33911MITPHP

Since Oct 18Pushed 8y ago2 watchersCompare

[ Source](https://github.com/sokil/php-opengraph)[ Packagist](https://packagist.org/packages/sokil/php-social-opengraph)[ RSS](/packages/sokil-php-social-opengraph/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

php-opengraph
=============

[](#php-opengraph)

[![Total Downloads](https://camo.githubusercontent.com/85504451fea295516c3482d4a3c7da5c183cd590d3a8a828d56d7a63c70a4d81/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736f6b696c2f7068702d736f6369616c2d6f70656e67726170682e737667)](https://packagist.org/packages/sokil/php-social-opengraph)[![Build Status](https://camo.githubusercontent.com/7003c27de0f6e20b0c1bbe24674f47912d544febac79e6cb00bf42f3b4a276ac/68747470733a2f2f7472617669732d63692e6f72672f736f6b696c2f7068702d6f70656e67726170682e7376673f6272616e63683d6d61737465722631)](https://travis-ci.org/sokil/php-opengraph)

Lib to render open graph.

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

[](#installation)

```
composer require sokil/php-social-opengraph

```

Basic Usage
-----------

[](#basic-usage)

```
// Open Graph
$openGraph = new \Sokil\OpenGraph;
$openGraph
  ->setTitle('The Matrix Revolutions')
  ->setDescription('The human city of Zion ...')
  ->setType(\Sokil\OpenGraph::TYPE_PRODUCTS_MOVIE)
  ->setImage('https://server.com/Matrix_Revolutions_poster.jpg')
  ->setUrl('http://www.imdb.com/title/tt0242653/')
  ->setVideoUrl('https://server.com/3453245.torrent')
  ->setVideoType('application/x-bittorrent');
```

Then you can get opengraph as array. This may be useful to render meta tags in frameworks. Example for Yii:

```
$cs = Yii::app()->getClientScript();
foreach($openGraph->toArray() as $property => $content) {
    $cs->registerMetaTag($content, null, null, array(
        'property'  => $property,
    ));
}
```

You can render meta tags directly:

```
echo $openGraph->render();

// or just:
echo $openGraph;
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 95.8% 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 ~968 days

Total

2

Last Release

2932d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/902e21ecf6517341b1f2a3c2f93a3eb115396fc6524effaeabc816b481909e64?d=identicon)[sokil](/maintainers/sokil)

---

Top Contributors

[![sokil](https://avatars.githubusercontent.com/u/1829948?v=4)](https://github.com/sokil "sokil (23 commits)")[![Seeker1437](https://avatars.githubusercontent.com/u/19224236?v=4)](https://github.com/Seeker1437 "Seeker1437 (1 commits)")

---

Tags

opengraphphpsocial-networkopengraph

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sokil-php-social-opengraph/health.svg)

```
[![Health](https://phpackages.com/badges/sokil-php-social-opengraph/health.svg)](https://phpackages.com/packages/sokil-php-social-opengraph)
```

###  Alternatives

[artesaos/seotools

SEO Tools for Laravel and Lumen

3.4k5.3M63](/packages/artesaos-seotools)[embed/embed

PHP library to retrieve page info using oembed, opengraph, etc

2.1k11.6M112](/packages/embed-embed)[butschster/meta-tags

The most powerful and extendable tools for managing SEO Meta Tags in your Laravel project

631768.2k3](/packages/butschster-meta-tags)[arcanedev/seo-helper

SEO Helper is a framework agnostic package that provides tools &amp; helpers for SEO (Laravel supported).

331469.8k4](/packages/arcanedev-seo-helper)[honeystone/laravel-seo

SEO metadata and JSON-LD package for Laravel.

35476.1k](/packages/honeystone-laravel-seo)[chriskonnertz/open-graph

Class that assists in building Open Graph meta tags

116449.2k3](/packages/chriskonnertz-open-graph)

PHPackages © 2026

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