cline/morphism
Central registry for Laravel polymorphic key mapping. Define which primary key column (id/uuid/ulid) each model uses in morph relations, with migration macros, optional strict enforcement, and config-based setup—ideal for package authors.
morphTo, morphWith, or custom polymorphic associations). This aligns well with Laravel’s Eloquent ORM and API resource patterns, particularly in multi-tenant, multi-model, or content-agnostic architectures.HasMany, MorphMany) without reinventing core functionality.AppServiceProvider). No PHP version or Laravel version constraints are explicitly called out, but the 2026 release date suggests compatibility with Laravel 10+.morphTo? If not, is this a premature abstraction?morphMap, custom accessors) suffice? If not, what’s the trade-off?Post::morphTo()).toArray() or toResponse().switch statements, custom traits).AppServiceProvider:
$this->app->bind('morphism.resolver', function () {
return new CustomResolver();
});
composer.json.model_type, model_id) must align with the package’s expectations.just test and just lint from the package’s rules to enforce quality.How can I help you explore Laravel packages today?