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
Has Source Model

Has Source Model Laravel Package

brokeyourbike/has-source-model

A lightweight Laravel trait that gives any Eloquent model a polymorphic "source" relationship, letting you track and retrieve the record or model a row originated from with minimal setup.

View on GitHub
Deep Wiki
Context7

brokeyourbike/has-source-model adds a lightweight HasSourceModel trait that ties any Eloquent model back to the model it originated from through a polymorphic source relationship. Rather than duplicating foreign keys or adding ad-hoc columns, records store their origin as a single morph pair, and the trait exposes convenient helpers and scopes for traversing that link.

  • Polymorphic source() relation available out of the box
  • Simple accessor for resolving the originating model
  • Query scopes to filter records by source type or ID
  • Configurable column names to fit existing schemas
  • Drop-in trait that works with any Eloquent model
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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package