Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Eloquent Morph To One

Laravel Eloquent Morph To One Laravel Package

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.

View on GitHub
Deep Wiki
Context7

fidum/laravel-eloquent-morph-to-one adds a missing morphToOne relationship to Laravel Eloquent, making polymorphic one-to-one associations easier to express. It provides a familiar relationship API for linking a model to a single related record through a morph type/id pair, complementing Laravel’s built-in morphTo, morphOne, and morphMany relations.

  • Drop-in morphToOne() relation for Eloquent models
  • Complements morphTo, morphOne, and morphMany
  • Supports eager loading and query constraints
  • Lightweight, with no schema changes required
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console