PHPackages                             chamber-orchestra/meta - 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. [Database &amp; ORM](/categories/database)
4. /
5. chamber-orchestra/meta

ActiveLibrary[Database &amp; ORM](/categories/database)

chamber-orchestra/meta
======================

Symfony 8 library providing a Doctrine ORM trait for SEO meta fields — title, description, keywords, Open Graph image, and robots behaviour

v8.0.2(2mo ago)0445—0%1MITPHPPHP ^8.5CI passing

Since Feb 13Pushed 2mo agoCompare

[ Source](https://github.com/chamber-orchestra/meta)[ Packagist](https://packagist.org/packages/chamber-orchestra/meta)[ RSS](/packages/chamber-orchestra-meta/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (12)Versions (8)Used By (1)

ChamberOrchestra Meta
=====================

[](#chamberorchestra-meta)

[![PHP Composer](https://github.com/chamber-orchestra/meta/actions/workflows/php.yml/badge.svg)](https://github.com/chamber-orchestra/meta/actions/workflows/php.yml)[![PHPStan](https://camo.githubusercontent.com/745eb989b9e4903dc598fe2cc63ed4226198be55b7c729001cbd1ece7676fef6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6d61782d627269676874677265656e2e737667)](https://phpstan.org/)[![PHP-CS-Fixer](https://camo.githubusercontent.com/6ea88fbe545f6f06950dd97b31be7621fcb0a0056644de2ea36e44b7de33adc4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5045522d2d435325323025324625323053796d666f6e792d626c75652e737667)](https://cs.symfony.com/)[![Latest Stable Version](https://camo.githubusercontent.com/cca681991a95ecf0ce73ab300e3f1dba48f9782739d1112ea45e1c27972acac7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368616d6265722d6f72636865737472612f6d6574612e737667)](https://packagist.org/packages/chamber-orchestra/meta)[![Total Downloads](https://camo.githubusercontent.com/fcf47d59fe0a5d132f151fb51716a9ef76a4bc023ba508767ab05fc33641dbb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6368616d6265722d6f72636865737472612f6d6574612e737667)](https://packagist.org/packages/chamber-orchestra/meta)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP 8.5+](https://camo.githubusercontent.com/2371eeb1a98f81a6894947d4d7b429326ee7f4dbeb3d8940776b4ae7b8442725/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e352532422d3737374242342e737667)](https://www.php.net/)[![Symfony 8.0](https://camo.githubusercontent.com/daaa476b3cc456701380f7d0fbdc3bbe9983e89d3267f99870daa88aa719e181/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53796d666f6e792d382e302d3030303030302e737667)](https://symfony.com/)

Symfony 8 library providing a Doctrine ORM trait for SEO meta fields — title, description, keywords, Open Graph image, and robots behaviour. Mix into any Doctrine entity with zero boilerplate.

Features
--------

[](#features)

- **`MetaTrait`** — adds SEO fields to any Doctrine entity via a single `use` statement
- **`RobotsBehaviour`** — int-backed PHP enum with `format()` for robots meta tag output (`index, follow`, `noindex, nofollow`, etc.)
- **`getMeta()`** — returns a clean associative array for rendering, with automatic HTML stripping on descriptions
- **Native Doctrine enum mapping** — `RobotsBehaviour` stored as `SMALLINT` with `enumType`, hydrated directly as an enum case
- **File-bundle integration** — transient `File $metaImage` property with `#[UploadableProperty]` for automatic image upload handling via `chamber-orchestra/file-bundle`

Requirements
------------

[](#requirements)

- PHP ^8.5
- Symfony ^8.0
- Doctrine ORM ^3.0
- `chamber-orchestra/view-bundle` ^8.0
- `chamber-orchestra/file-bundle` (in consuming application, for image upload support)

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

[](#installation)

```
composer require chamber-orchestra/meta
```

Usage
-----

[](#usage)

### 1. Add meta fields to your entity

[](#1-add-meta-fields-to-your-entity)

```
use ChamberOrchestra\FileBundle\Mapping\Annotation as Upload;
use ChamberOrchestra\Meta\Entity\MetaTrait;
use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
#[Upload\Uploadable(prefix: 'article')]
class Article
{
    use MetaTrait;

    #[ORM\Id]
    #[ORM\GeneratedValue]
    #[ORM\Column]
    private ?int $id = null;

    // your entity fields...
}
```

The `#[Uploadable]` attribute is required for file-bundle to handle the `metaImage` upload automatically.

This adds the following columns and properties:

PropertyTypePersistedDescription`title``string`yesPage title (H1)`metaTitle``string`yes`` / og:title`metaImage``File`noTransient upload (file-bundle)`metaImagePath``string`yesSocial share image path`metaDescription``text`yesMeta description`metaKeywords``string`yesMeta keywords`robotsBehaviour``smallint`yesRobots enum (default: 1)### 2. Render meta tags in Twig

[](#2-render-meta-tags-in-twig)

Pass the `getMeta()` array and the entity to your base layout, then build the ``:

```
{# base.html.twig #}
{% set meta = entity.meta %}

{%- set title -%}
    {{ "meta.title.common"|trans }}{{ meta.title|default('') ? ' | ' ~ meta.title }}
    {%- if app.request.query.has("page") and app.request.query.get("page") > 1 -%}
        | {{ "meta.title.page"|trans({"page": app.request.query.get("page")}) -}}
    {%- endif -%}
{%- endset -%}
{%- set title = title|replace({"\n": "", "\r\n": "", "\t": "", "\n\r": ""})|trim -%}
{%- set description = meta.description|default("meta.description.common"|trans) -%}
{%- set keywords = meta.keywords|default("meta.keywords.common"|trans) -%}
{%- set socialTitle = meta.title|default(title) -%}
{%- set socialDescription = meta.description|default(description) -%}

    {{ title }}

    {%- if
        not app.request.query.has("page")
        and not app.request.query.has("filter")
        and not app.request.query.has("sort")
        and not app.request.query.has("order")
        and not app.request.query.has("limit") -%}

    {%- endif %}

    {%- if meta.image %}

    {%- endif %}

    {% block stylesheets %}{% endblock %}

```

The `getMeta()` method automatically strips HTML tags from the description.

### 3. Robots behaviour enum

[](#3-robots-behaviour-enum)

```
use ChamberOrchestra\Meta\Entity\Helper\RobotsBehaviour;

$entity->getRobotsBehaviour();              // RobotsBehaviour::IndexNoFollow
$entity->getFormattedRobotsBehaviour();     // "index, nofollow"

RobotsBehaviour::NoIndexNoFollow->format(); // "noindex, nofollow"
```

Available cases:

CaseValueOutput`IndexFollow`0`index, follow``IndexNoFollow`1`index, nofollow``NoIndexFollow`2`noindex, follow``NoIndexNoFollow`3`noindex, nofollow`Testing
-------

[](#testing)

```
composer install
composer test
composer analyse
composer cs-check
```

License
-------

[](#license)

MIT

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance85

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~2 days

Total

6

Last Release

77d ago

Major Versions

v0.0.2 → v8.0.22026-03-02

v0.0.3 → 8.0.x-dev2026-03-03

### Community

Maintainers

![](https://www.gravatar.com/avatar/44037eb1c8dc2c4fa9871ac213653f33e22a9348dcec7132df07cc71933f2a2e?d=identicon)[wtorsi](/maintainers/wtorsi)

---

Top Contributors

[![wtorsi](https://avatars.githubusercontent.com/u/2115840?v=4)](https://github.com/wtorsi "wtorsi (4 commits)")

---

Tags

doctrinemeta-tagsopen-graphormphprobotsseosymfonysymfony-bundlephpsymfonyormdoctrineseometarobotsopen-graphmeta-tags

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/chamber-orchestra-meta/health.svg)

```
[![Health](https://phpackages.com/badges/chamber-orchestra-meta/health.svg)](https://phpackages.com/packages/chamber-orchestra-meta)
```

###  Alternatives

[sonata-project/doctrine-orm-admin-bundle

Integrate Doctrine ORM into the SonataAdminBundle

46117.7M155](/packages/sonata-project-doctrine-orm-admin-bundle)[fourlabs/qbjs-parser

Parse JSON coming from jQuery QueryBuilder, into database queries.

2535.3k2](/packages/fourlabs-qbjs-parser)[fourlabs/qbjs-parser-bundle

This bundle is a Symfony wrapper for fourlabs/qbjs-parser.

1514.7k1](/packages/fourlabs-qbjs-parser-bundle)

PHPackages © 2026

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