cline/morphism

Reusable polymorphic key mapping for Laravel packages
18,573
Install
composer require cline/morphism
Latest Version:2.0.3
PHP:^8.5.0
License:MIT
Last Updated:Mar 18, 2026
Links: GitHub  ·  Packagist
Maintainer: faustbrian

GitHub Workflow Status Latest Version on Packagist Software License Total Downloads


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

Requires PHP 8.4+ and Laravel 12+

Installation

composer require cline/morphism

Documentation

Change log

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please use the GitHub security reporting form rather than the issue queue.

Credits

License

The MIT License. Please see License File for more information.

Related Packages

goldspecdigital/laravel-eloquent-uuid

A simple drop-in solution for providing UUID support for the IDs of your Eloquen...

1,357,983 507
cline/strongly-typed-id

Strongly-typed ID value objects for PHP with support for UUID, ULID, NanoID, GUI...

6,980 0
gbuckingham89/eloquent-uuid

A simple package for using UUID's (UUID4) with Laravel's Eloquent.

4,787 1
lingfengchencn/eloquent-uuid-for-key

uuid4 key for laravel's eloquent

25 1