PHPackages                             optimuscms/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. optimuscms/meta

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

optimuscms/meta
===============

Store meta data for the web against your Laravel Models

v1.1.1(6y ago)0331PHPPHP ^7.1.3

Since Aug 13Pushed 6y ago1 watchersCompare

[ Source](https://github.com/optimuscms/meta)[ Packagist](https://packagist.org/packages/optimuscms/meta)[ RSS](/packages/optimuscms-meta/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (1)

Meta
====

[](#meta)

Provides a standardised approach to attaching website meta data to Laravel Models. Typically this is used for entities such as Pages, Blog Posts, Events, etc, which will need fields like 'Meta Title', 'Meta Description', and 'OG Image' when they are presented on the web.

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

[](#installation)

You can install the package via composer:

```
composer require optimuscms/meta
```

Once installed, you should add the tables used by this package to your database:

```
php artisan migrate
```

Key concepts
------------

[](#key-concepts)

There are a few key concepts that should be understood before continuing:

- A new model called Meta will be attached to whichever Models you define as requiring meta data.
- It is a 'has one' relationship where the Model can have zero or one Meta Model attached to it.
- The Meta Model depends on the [optimuscms/media](https://github.com/optimuscms/media) package in order to attach images to it.

Usage
-----

[](#usage)

1. Add the `HasMeta` trait to whatever Model you want to collect meta data for:

    ```
    class MyModel extends Model
    {
        use Optix\Meta\HasMeta;
    ```
2. Add a boot method to your Model (if it doesn't already exist) with the following content:

    ```
    protected static function boot()
    {
        parent::boot();

        static::saved(function ($model) {
            /** @var HasMeta $model */
            $model->saveMeta(request('meta'));
        });
    }
    ```
3. (Optional) If your Model appears in an API response, you'll want to add the meta property (either to the Model directly, or in a Resource class if you're using one):

    ```
    public function toArray()
    {
       return [
           ...other properties,
           'meta' => $this->meta,
       ];
    }
    ```
4. When creating or updating your model (eg. from a CMS action), make sure your form submits its request in the following format:

    ```
    {
        ...MODEL_FIELDS,
        meta: {
            title, // max 100 chars
            description, // max 200 chars
            og_title, // max 100 chars
            og_description, // max 200 chars
            og_image_id, // the id of a Media Model
            custom_tags // free text field for adding custom HTML
        }
    }
    ```

    All fields are optional and this package will automatically pick them up and process them as required.

Retrieving OG images
--------------------

[](#retrieving-og-images)

This package also provides a convenient way to retrieve the OG image as a Media Model:

```
$media = $myModel->meta->getOgImage();
```

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

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 ~0 days

Total

4

Last Release

2513d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/39189831?v=4)[OptimusCMS](/maintainers/optimuscms)[@optimuscms](https://github.com/optimuscms)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M220](/packages/backpack-crud)[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11223.5M33](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[mozex/laravel-scout-bulk-actions

Import, flush, and queue-import all your Laravel Scout searchable models at once. Auto-discovers models, runs in bulk, tracks progress.

1539.3k](/packages/mozex-laravel-scout-bulk-actions)[ramadan/easy-model

A Laravel package for enjoyably managing database queries.

111.6k](/packages/ramadan-easy-model)

PHPackages © 2026

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