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

ActiveLibrary

litstack/meta
=============

v2.0.8(1y ago)05.3k[1 issues](https://github.com/litstack/meta/issues)1MITPHP

Since Mar 4Pushed 1y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (15)Used By (1)

Litstack Meta
=============

[](#litstack-meta)

Edit default meta-fields inside your crud-models and forms and receive them in your blade templates.

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

[](#installation)

The package can be installed via composer and will autoregister.

```
composer require litstack/meta
```

You can now publish and migrate the migration for your meta model:

```
php artisan vendor:publish --provider="Litstack\Meta\MetaServiceProvider" --tag=migrations
php artisan migrate
```

Usage
-----

[](#usage)

Start by perparing your Crud-Model by using the `HasMeta` Trait and implement the `metaable` Contract:

```
use Litstack\Meta\Metaable;
use Litstack\Meta\Traits\HasMeta;

class Post extends Model implements Metaable
{
    use HasMeta;
}
```

In order to display the form in litstack edit your model-config:

```
public function show()
{
    $page->card(function($form) {
        $form->seo();
    });
}

```

To display the meta-fields in your template, simply use the `` component and pass it the `metaFields` of your model.

```
@extends('app')

@section('meta')

@endsection
```

And in your main template:

```

    @yield('meta')

```

Default Values / Customizing / Overriding
-----------------------------------------

[](#default-values--customizing--overriding)

If you want to use meta attributes directly from model attributes you can specify them in `metaAttributes` in your config. You may as well override the meta methods like `metaAuthor` to return dynamic meta attributes:

```
class Post extends Model implements Metaable
{
    use HasMeta;

    protected $metaAttributes = [
        'author' => 'author.name',
        'image'  => 'header_image',
    ];

    public function getHeaderImageAttribute()
    {
        // ...
    }

    public function metaTitle(): ?string
    {
        // Return a prefix:
        return "Awesome Blog: " . parent::metaTitle();
    }
}
```

You may set default attributes by setting `defaultMetaAttributes` or add a method `defaultMeta...` method:

```
class Post extends Model implements Metaable
{
    use HasMeta;

    protected $defaultMetaAttribute = [
        'description' => 'description',
    ];

    public function defaultMetaTitle()
    {

    }
}
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance47

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 53.1% 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 ~115 days

Recently: every ~315 days

Total

14

Last Release

399d ago

Major Versions

v1.0.2 → v2.0.02021-07-14

v1.1 → v2.0.12021-09-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/29352871?v=4)[Lennart Carstens-Behrens](/maintainers/cbl)[@cbl](https://github.com/cbl)

---

Top Contributors

[![jannescb](https://avatars.githubusercontent.com/u/17292622?v=4)](https://github.com/jannescb "jannescb (17 commits)")[![cbl](https://avatars.githubusercontent.com/u/29352871?v=4)](https://github.com/cbl "cbl (12 commits)")[![aw-gerrit](https://avatars.githubusercontent.com/u/67461498?v=4)](https://github.com/aw-gerrit "aw-gerrit (1 commits)")[![Chrissle28](https://avatars.githubusercontent.com/u/69738385?v=4)](https://github.com/Chrissle28 "Chrissle28 (1 commits)")[![lpheller](https://avatars.githubusercontent.com/u/36259611?v=4)](https://github.com/lpheller "lpheller (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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