fidum/laravel-eloquent-morph-to-one
Adds a MorphToOne relationship to Laravel's Eloquent ORM, letting a model own a single polymorphic related record. Useful when a parent has exactly one morph child, mirroring MorphMany but returning a single model with lazy and eager loading support.
Architecture fit
fidum/laravel-eloquent-morph-to-one is a single-purpose Eloquent extension: it adds a morphToOne relationship so a model can express a polymorphic "to one" association and consume it through Laravel's standard relationship APIs (eager loading, whereHas, constraints). It slots into the existing Eloquent relationship layer rather than introducing a new persistence model — no schema changes, no service provider ceremony beyond package discovery, and it composes with native morphTo/morphOne/morphMany. For a Laravel codebase already using polymorphic relations, this is architecturally low-friction.
Integration feasibility
Drop-in via Composer with one relationship method per model. The only prerequisites are the morph columns already present in the schema and a consistent morph map. Because the release only widens framework/runtime constraints, integration effort is unchanged from 2.5.x: composer require plus relationship definitions.
Technical risk Low intrinsic risk; the relationship logic is thin and well-scoped. The material risk in 2.6.0 is version-coupling: the release adds Laravel 13.x and PHP 8.5 support, both of which are leading-edge targets. If those platforms are not yet GA in your environment, this release signals forward-compatibility rather than something you adopt now. There is also a maintenance-concentration risk: the package is effectively single-maintainer (@dmason30 / fidum), so major-framework support depends on that individual staying active — 2.6.0 is a positive signal on that front.
Key questions
composer.json constraints (allowing 13.x/8.5 while retaining 10/11/12 and older PHP), or did it drop prior-version support? This determines whether the upgrade is safe for teams still on Laravel 11/12.enforceMorphMap enabled?Stack fit
Fits any Laravel application — monolith or modular — that models polymorphic ownership and wants a first-class "to one" relationship on the owning side. It is additive: teams can adopt it for new relationships without touching existing morphTo/morphOne usage.
Migration path
morphToOne relationships, and eager-load where needed. No data migration; the morph columns already exist.composer update fidum/laravel-eloquent-morph-to-one to 2.6.0. This is a minor release whose stated change is compatibility expansion — expect a no-op code change. Validate that no transitive constraint shifts occurred.Compatibility The release explicitly targets Laravel 13.x and PHP 8.5. Confirm the package's floor (minimum Laravel/PHP) is unchanged before rolling into a pinned environment. If your platform is Laravel 10–12 / PHP 8.2–8.4, verify 2.6.0 still declares support for those ranges.
Sequencing
composer.json constraints in 2.6.0.Maintenance Very low. Single-file-ish dependency, stable 2.x line, infrequent releases. The only recurring maintenance task is tracking Laravel annual majors and PHP minor releases — which 2.6.0 demonstrates the maintainer is doing.
Support Community/open-source only; GitHub issues and PRs. No commercial SLA. For a critical polymorphic relationship, plan for the possibility of pinning a version or, in the worst case, vendoring the small relationship class.
Scaling
No runtime scaling concern — resolution is per-query and behaves like other Eloquent relations. The operational lever is eager loading: without with(), morphToOne can produce N+1 queries just like native polymorphic relations. Enforce eager loading in code review / query monitoring.
Failure modes
Class not found / null resolution.Ramp-up
Minimal. Developers fluent in Eloquent grasp morphToOne quickly; the main onboarding need is documenting when to use it versus native morphTo/morphOne so the team doesn't fragment its polymorphic modeling conventions. Budget a short internal note plus a test example.
How can I help you explore Laravel packages today?