PHPackages                             cline/morphism - 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. cline/morphism

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

cline/morphism
==============

Reusable polymorphic key mapping for Laravel packages

2.0.1(2mo ago)07.0k—7.3%6MITPHPPHP ^8.5.0CI passing

Since Nov 25Pushed 2mo agoCompare

[ Source](https://github.com/faustbrian/morphism)[ Packagist](https://packagist.org/packages/cline/morphism)[ RSS](/packages/cline-morphism/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (2)Dependencies (10)Versions (12)Used By (6)

[![GitHub Workflow Status](https://github.com/faustbrian/morphism/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/morphism/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/f3acc9d25f1c3ec9733b0032dba06a73af5090b1b7ea4be89f9cf66f5a3120ba/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f6d6f72706869736d2e737667)](https://packagist.org/packages/cline/morphism)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/101b38edb9ce8c1ebcd3d532d30b62bac2f9c10c49d5d9ba7aa287ad971388a5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f6d6f72706869736d2e737667)](https://packagist.org/packages/cline/morphism)

---

Reusable polymorphic key mapping for Laravel packages. Provides a central registry to manage which primary key column (id, uuid, ulid) each model uses in polymorphic relationships.

Requirements
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/)** and Laravel 12+

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

[](#installation)

```
composer require cline/morphism
```

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

[](#documentation)

- **[Migrations](DOCS.md#doc-cookbooks-migrations)** - Blueprint macros for polymorphic columns
- **[Basic Usage](DOCS.md#doc-cookbooks-basic-usage)** - Core registry operations
- **[Strict Enforcement](DOCS.md#doc-cookbooks-strict-enforcement)** - Require all models to be mapped
- **[Config-Based Setup](DOCS.md#doc-cookbooks-config-based-setup)** - Configure via config files
- **[Package Integration](DOCS.md#doc-cookbooks-package-integration)** - Integrate into your own packages
- **[Testing](DOCS.md)** - Testing patterns and best practices

Change log
----------

[](#change-log)

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

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/morphism/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance87

Actively maintained with recent releases

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity59

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

Recently: every ~16 days

Total

11

Last Release

75d ago

Major Versions

1.x-dev → 2.0.02026-03-04

PHP version history (2 changes)1.0.0PHP ^8.4.0

1.1.0PHP ^8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (11 commits)")

---

Tags

phplaraveleloquentuuidulidmorphpolymorphic

### Embed Badge

![Health badge](/badges/cline-morphism/health.svg)

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

###  Alternatives

[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[spiritix/lada-cache

A Redis based, automated and scalable database caching layer for Laravel

591444.8k2](/packages/spiritix-lada-cache)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)[cybercog/laravel-love

Make Laravel Eloquent models reactable with any type of emotions in a minutes!

1.2k302.7k1](/packages/cybercog-laravel-love)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[io238/laravel-iso-countries

Ready-to-use Laravel models and relations for country (ISO 3166), language (ISO 639-1), and currency (ISO 4217) information with multi-language support.

5462.3k](/packages/io238-laravel-iso-countries)

PHPackages © 2026

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