PHPackages                             jobmetric/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jobmetric/laravel-metadata

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

jobmetric/laravel-metadata
==========================

This package is for the metadata of different Laravel projects.

3.7.0(4mo ago)978↓75%24MITPHPPHP &gt;=8.0.1CI passing

Since Aug 25Pushed 4mo ago2 watchersCompare

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

READMEChangelog (4)Dependencies (6)Versions (35)Used By (4)

[![Contributors](https://camo.githubusercontent.com/2db278c80f55eb9526c15911446cbdad86ee23fc0e7bfd893e1490b083c287d0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f6a6f626d65747269632f6c61726176656c2d6d657461646174612e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-metadata/graphs/contributors)[![Forks](https://camo.githubusercontent.com/2174170e29d8ef3eb43c3788f0946986bdec87a505ab664affa690b71ca95040/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6a6f626d65747269632f6c61726176656c2d6d657461646174612e7376673f7374796c653d666f722d7468652d6261646765266c6162656c3d466f726b)](https://github.com/jobmetric/laravel-metadata/network/members)[![Stargazers](https://camo.githubusercontent.com/101029d4034cceb4422c64ef8b1dbfc66cf9e30ade14de2aeb7367448f4c23d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6a6f626d65747269632f6c61726176656c2d6d657461646174612e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-metadata/stargazers)[![MIT License](https://camo.githubusercontent.com/a4bc351b169987e35697070f2f535053cbde2134df6c8ccf9be6579381f0efd6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6f626d65747269632f6c61726176656c2d6d657461646174612e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/jobmetric/laravel-metadata/blob/master/LICENCE.md)[![LinkedIn](https://camo.githubusercontent.com/eb590f47a3fca74584d18db8dd3e985ae3d786f50cd41b7530c3af3885da233c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d4c696e6b6564496e2d626c75652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6c696e6b6564696e26636f6c6f72423d353535)](https://linkedin.com/in/majidmohammadian)

Laravel Metadata
================

[](#laravel-metadata)

**Manage Metadata. Simply and Flexibly.**

Laravel Metadata simplifies storing dynamic key-value data for your Eloquent models. Stop modifying database schemas for every new field and start managing extensible data with ease. It provides a robust and flexible metadata system that enables you to attach dynamic key-value data to any model through a polymorphic relationship—perfect for storing custom fields, settings, options, and user-defined attributes without modifying your database schema. This is where powerful metadata management meets developer-friendly simplicity—giving you complete control over dynamic data without the complexity.

Why Laravel Metadata?
---------------------

[](#why-laravel-metadata)

### Dynamic Key-Value Storage

[](#dynamic-key-value-storage)

Laravel Metadata allows you to store arbitrary key-value pairs for any Eloquent model without modifying the model's table structure. This is perfect for storing custom fields, user preferences, product attributes, and any other extensible data.

### Polymorphic Relationships

[](#polymorphic-relationships)

The package uses Laravel's polymorphic relationships, allowing a single `metas` table to store metadata for multiple model types. This keeps your database schema clean and maintainable while providing maximum flexibility.

### Key Whitelisting

[](#key-whitelisting)

Control which metadata keys are allowed for each model. Define a whitelist of allowed keys to prevent typos and ensure data integrity, or use `['*']` to allow all keys.

### Automatic JSON Handling

[](#automatic-json-handling)

Arrays and objects are automatically JSON-encoded when stored and decoded when retrieved. The package tracks which values are JSON, ensuring proper type handling.

What is Metadata Management?
----------------------------

[](#what-is-metadata-management)

Metadata management is the process of storing and retrieving additional information about your models that doesn't fit into the main table structure. Traditional approaches often require:

- Adding columns to tables (inflexible)
- Creating separate tables for each model (redundant)
- Using JSON columns (limited querying)

Laravel Metadata solves these challenges by providing:

- **Polymorphic Storage**: One table for all metadata across all models
- **Dynamic Keys**: Add new metadata keys without schema changes
- **Type Safety**: Automatic JSON encoding/decoding
- **Query Support**: Filter and search by metadata
- **Key Control**: Whitelist allowed keys per model

Consider an e-commerce system where products need different attributes based on their category. With Laravel Metadata, you can store category-specific attributes dynamically, query products by these attributes, and manage them through a simple API. The power of metadata management lies not only in flexible storage but also in making it easy to query, filter, and manage throughout your application.

What Awaits You?
----------------

[](#what-awaits-you)

By adopting Laravel Metadata, you will:

- **Store extensible data** - Add custom fields without schema changes
- **Simplify data management** - One table for metadata across all models
- **Improve flexibility** - Dynamic keys that adapt to your needs
- **Enhance querying** - Filter and search by metadata values
- **Maintain data integrity** - Key whitelisting prevents errors
- **Maintain clean code** - Simple, intuitive API that follows Laravel conventions

Quick Start
-----------

[](#quick-start)

Install Laravel Metadata via Composer:

```
composer require jobmetric/laravel-metadata
```

Documentation
-------------

[](#documentation)

Ready to transform your Laravel applications? Our comprehensive documentation is your gateway to mastering Laravel Metadata:

**[📚 Read Full Documentation →](https://jobmetric.github.io/packages/laravel-metadata/)**

The documentation includes:

- **Getting Started** - Quick introduction and installation guide
- **HasMeta** - Core trait for adding metadata functionality to models
- **HasFilterMeta** - Dynamic filtering capabilities based on metadata
- **HasDynamicMeta** - Integration with custom field systems
- **Resources** - API response transformation
- **Events** - Hook into metadata lifecycle
- **Real-World Examples** - See how it works in practice

Contributing
------------

[](#contributing)

Thank you for participating in `laravel-metadata`. A contribution guide can be found [here](CONTRIBUTING.md).

License
-------

[](#license)

The `laravel-metadata` is open-sourced software licensed under the MIT license. See [License File](LICENCE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance76

Regular maintenance activity

Popularity19

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 94.6% 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 ~26 days

Recently: every ~4 days

Total

34

Last Release

133d ago

Major Versions

1.0.0 → 2.0.02024-01-15

2.10.0 → 3.0.02025-08-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/b00d08bd4b0b765ee2d33719a535e6cb49c04fb945078a0809d5c05e6f16ee96?d=identicon)[majidmohammadian](/maintainers/majidmohammadian)

---

Top Contributors

[![MajidMohammadian](https://avatars.githubusercontent.com/u/2099965?v=4)](https://github.com/MajidMohammadian "MajidMohammadian (141 commits)")[![Bagheri-Matin](https://avatars.githubusercontent.com/u/239607447?v=4)](https://github.com/Bagheri-Matin "Bagheri-Matin (6 commits)")[![H-0-O](https://avatars.githubusercontent.com/u/93187411?v=4)](https://github.com/H-0-O "H-0-O (2 commits)")

---

Tags

laravellaravel-packagemetametadatapackage

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[wireui/wireui

TallStack components

1.8k1.3M16](/packages/wireui-wireui)[ramonrietdijk/livewire-tables

Dynamic tables for models with Laravel Livewire

21147.4k](/packages/ramonrietdijk-livewire-tables)

PHPackages © 2026

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