PHPackages                             smurfworks/laravel-model-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. smurfworks/laravel-model-meta

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

smurfworks/laravel-model-meta
=============================

Dynamically configure and capture strictly-typed metadata for your Laravel models as fluent attributes

v0.0.4(2y ago)131[2 PRs](https://github.com/SmurfWorks/laravel-model-meta/pulls)MITPHP ^8.1

Since Jan 1Compare

[ Source](https://github.com/SmurfWorks/laravel-model-meta)[ Packagist](https://packagist.org/packages/smurfworks/laravel-model-meta)[ Docs](https://github.com/smurfworks/laravel-model-meta)[ GitHub Sponsors](https://github.com/SmurfWorks)[ RSS](/packages/smurfworks-laravel-model-meta/feed)WikiDiscussions Synced 2d ago

READMEChangelog (4)Dependencies (13)Versions (7)Used By (0)

Dynamically configure and capture strictly-typed metadata for your Laravel models as fluent attributes
======================================================================================================

[](#dynamically-configure-and-capture-strictly-typed-metadata-for-your-laravel-models-as-fluent-attributes)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5d1b3f3702993bf20bf7ede8a2f1f33c41722b964945f429dee5a6eae0764ed0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736d757266776f726b732f6c61726176656c2d6d6f64656c2d6d6574612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smurfworks/laravel-model-meta)[![GitHub Tests Action Status](https://camo.githubusercontent.com/94c2cd30f6425e9fac37734acaf98a231b10a953e8022917106e028efee9de62/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d757266776f726b732f6c61726176656c2d6d6f64656c2d6d6574612f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/smurfworks/laravel-model-meta/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d7eddd08f003fb224519a8e21795b7ad18d4532caa77d381e80b338e6e1db315/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736d757266776f726b732f6c61726176656c2d6d6f64656c2d6d6574612f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/smurfworks/laravel-model-meta/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b6ae257b52279a9872aa3aabdadf605416ce16fbed1e393f1527e088b9906664/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736d757266776f726b732f6c61726176656c2d6d6f64656c2d6d6574612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/smurfworks/laravel-model-meta)

"Laravel Model Meta" allows you to capture strictly typed field values for a model without having to alter a database schema.

What separates this package from other meta packages available? A combination of the following:

- **Quick to implement with low domain impact:** This package will create only one meta table, regardless of the number of models you wish to store meta for and use a polymorphic relation.
- **Queryable data:** This package does not use JSON to serialize a model's meta, and instead the meta values are stored in separate database fields depending on the configured meta key's storage type, allowing for database querying using type-dependent operators and indexing.
- **Strict typing and content management:** The available meta keys are stored in their own database table, allowing for easy configuration via the command line, migration or your own custom GUI.
- **Reduced query load:** Available meta fields are cached using an index created from the available meta key table after changes - no unnecessary database queries and no schema column listing queries.
- **Compatible with your project flow:** Seeder helpers for importing meta keys from the standard Laravel seeding command, useful for project setup or keeping migrations ephemeral. Otherwise, register your model keys manually via the command line.
- **Along for the ride:** Transform meta values from one type to another, or move them to a new schema field once validated as required by your domain.
- **Database driver agnostic:** The package allows you to disable certain meta value types if your database driver doesn't support them, or you simply don't want them in the schema, so it won't create the columns when running migrations.

**To save you time, you should know that to use this package, the Primary keys of your models with metadata values must be incremental** - UUID relations are not currently supported. To solve this, you could alter the migrations and create your own class.

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

[](#installation)

Please see [INSTALL](readme/INSTALL.md) for more information on how to install the package.

Usage
-----

[](#usage)

Please see [USAGE](readme/USAGE.md) for more information on how to use the package.

Configuration
-------------

[](#configuration)

Please see [CONFIGURATION](readme/CONFIGURATION.md) for more information on how to configure the package.

Advanced details
----------------

[](#advanced-details)

For more information about some of the key design decisions and implementation details, please see [ADVANCED](readme/ADVANCED.md).

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing and Security Vulnerabilities
-----------------------------------------

[](#contributing-and-security-vulnerabilities)

Please see [CONTRIBUTING](readme/CONTRIBUTING.md) for details.

License
-------

[](#license)

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

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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 ~1 days

Total

4

Last Release

910d ago

### Community

Maintainers

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

---

Top Contributors

[![SmurfWorks](https://avatars.githubusercontent.com/u/396926?v=4)](https://github.com/SmurfWorks "SmurfWorks (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravellaravel-model-metaSmurfWorks

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/smurfworks-laravel-model-meta/health.svg)

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

###  Alternatives

[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[wnx/laravel-backup-restore

A package to restore database backups made with spatie/laravel-backup.

213421.0k2](/packages/wnx-laravel-backup-restore)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[lacodix/laravel-model-filter

A Laravel package to filter, search and sort models with ease while fetching from database.

17558.6k](/packages/lacodix-laravel-model-filter)

PHPackages © 2026

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