PHPackages                             quadcompanies/metadata - 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. quadcompanies/metadata

ActiveLibrary

quadcompanies/metadata
======================

A unified Metadata, SEO, and Social Media library for Laravel.

1.1(2mo ago)029↓50%MITPHPPHP ^8.1

Since Jan 28Pushed 2mo agoCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

QuadCompanies Metadata
======================

[](#quadcompanies-metadata)

A unified Metadata, SEO, and Social Media library for Laravel. Define your page information once and render it everywhere: HTML Meta tags, Open Graph, Twitter Cards, and Schema.org JSON-LD.

Features
--------

[](#features)

- **Fluent API**: Easily set metadata in your controllers.
- **Eloquent Integration**: Use the `HasMetadata` trait to map model attributes to SEO fields automatically.
- **Blade Directive**: Simple `@metadata` directive to render everything in your ``.
- **Schema.org**: Helpers for generating standard JSON-LD scripts.
- **Sitemaps**: Generate `sitemap.xml` via Artisan command.

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

[](#installation)

```
composer require quadcompanies/metadata
```

Usage
-----

[](#usage)

### 1. Define Once (Controller)

[](#1-define-once-controller)

```
use QuadCompanies\Metadata\Facades\Metadata;

public function show(Product $product)
{
    Metadata::title($product->name)
        ->description($product->excerpt)
        ->image($product->featured_image_url)
        ->url(url()->current())
        ->siteName('My Awesome Store')
        ->twitterCard('summary_large_image');

    return view('products.show', compact('product'));
}
```

### 2. Render Everywhere (Blade)

[](#2-render-everywhere-blade)

Add the directive to your layout's ``:

```
>

    @metadata

...
```

### 3. Eloquent Integration

[](#3-eloquent-integration)

Add the `HasMetadata` trait to your models:

```
use QuadCompanies\Metadata\Traits\HasMetadata;

class Post extends Model
{
    use HasMetadata;

    public function metadataMapping(): array
    {
        return [
            'title' => 'title',
            'description' => 'excerpt',
            'image' => fn($model) => $model->getFirstMediaUrl('images'),
        ];
    }
}
```

Then in your controller:

```
public function show(Post $post)
{
    $post->applyMetadata();
    return view('posts.show');
}
```

### 4. Schema.org JSON-LD

[](#4-schemaorg-json-ld)

```
use QuadCompanies\Metadata\Schema\SchemaBuilder;

Metadata::addSchema(SchemaBuilder::article([
    'headline' => 'Awesome Article',
    'author' => ['@type' => 'Person', 'name' => 'John Doe'],
]));
```

### 5. Sitemaps

[](#5-sitemaps)

To generate a sitemap:

```
php artisan metadata:sitemap
```

Standards
---------

[](#standards)

This package follows PSR-12 coding standards and is designed to be data-agnostic (no migrations required).

License
-------

[](#license)

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

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance83

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

88d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/03b1b891d07fd5b88e5d619929fb6c28f5290f7ea33681cd35a6e8f54b91d96f?d=identicon)[hanssignature](/maintainers/hanssignature)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/quadcompanies-metadata/health.svg)

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

PHPackages © 2026

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