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 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

Product Decisions This Supports

  • Provenance/attribution modeling for domain records. A HasSourceModel trait implies a reusable way to answer "where did this record come from?" (import, external system, upstream entity, user action). That underpins features like source filtering, import reconciliation, duplicate detection, and "origin" badges in admin UI.
  • Build vs. buy (leans "build"). The capability is a thin Eloquent trait plus a morphTo/belongsTo relation and a migration convention. For most teams this is a few hours of first-party code, which is cheaper than owning an external dependency's upgrade cadence — especially given the v3.0.0 signal below.
  • Roadmap sequencing. A major version bump indicates the maintainer is still evolving the public API. If provenance is on your near-term roadmap, plan to ship it behind your own interface (repository/trait wrapper) so an upstream breaking change is contained to one file.
  • Data-integrity and support tooling. Supports internal decisions like "can support answer 'which import created this record' without engineering?" and "can we backfill/repair by source?" — both reduce support load and cleanup cost.
  • Do not use this release to justify compliance-grade lineage. Audit/traceability requirements (regulated data, retention, reproducibility) need owned schema and immutability guarantees; a single-maintainer convenience package is not the right substrate for that promise.

When to Consider This Package

  • Consider it when: you need lightweight, polymorphic source attribution across several models, you are already comfortable with Eloquent morph relations, and you can pin the version and read the diff before upgrading.
  • Consider it only with a wrapper when: provenance is becoming a customer-visible or contractual feature — isolate the trait behind your own abstraction so a v4 does not ripple through the codebase.
  • Look elsewhere or build in-house when: you need audit-grade lineage, event history, or retention guarantees; you have multiple engineers who would each spend more time reviewing this dependency than writing the trait; or your organization requires documented changelogs and a supported migration path for major upgrades.
  • Red flags in this specific release: v3.0.0 is flagged as a breaking change, yet the notes contain no migration guidance — the entries are effectively noise ("braking", "button", "reference"), with no description of what broke, which methods or relation names changed, or whether a data migration is required. A breaking release with an unreadable changelog is a real adoption cost: every consumer must diff the source to assess impact. Treat that as a maintenance-quality signal, not just a documentation nit.
  • Gate to adoption: pin to an exact tag, review the commit range between v2 and v3 directly in the repository, confirm test coverage and PHP/Laravel version support, and check the maintainer's release cadence and issue responsiveness before committing.

How to Pitch It (Stakeholders)

To executives (one line): This is a small open-source helper for tracking where each record in our system came from — useful for import reconciliation and support tooling, but the latest release is a breaking change published without usable release notes, so the recommendation is to defer adoption or implement the equivalent ourselves rather than take on an unmanaged dependency.

To engineering: The package gives us a HasSourceModel trait for polymorphic source attribution. Functionally it is close to something we could own in a day. The blocker is v3.0.0: a major bump whose changelog does not describe what broke, so anyone upgrading has to read the diff. If we adopt, pin the tag, wrap the trait behind our own interface, and review the v2→v3 commit range first. If we only need one or two models to carry a source, write it ourselves and skip the dependency entirely.

Recommendation: No adoption decision on this release alone. Build in-house if the need is narrow (likely the cheaper path); revisit the package only if the maintainer publishes a real migration guide and the API stabilizes across a minor cycle.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings