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

Nestablecollection Laravel Package

hsharghi/nestablecollection

NestableCollection is a Laravel package that extends collections for working with nested, hierarchical data. Build trees, traverse parents and children, and manage nested sets with a familiar collection API, keeping your models and arrays organized.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for hierarchy features: This package handles parent/child (adjacency list) relationships — categories, org charts, comment threads, menu trees — so the team can ship nested data models without hand-rolling recursive queries and tree traversal logic.
  • Schema flexibility / integration with existing data: Release 1.1.20 adds parentColumn('parent_column_name'), letting the package map to a non-default parent column. This is a meaningful unblocker for adopting the package against legacy or externally owned schemas where the column is not the conventional parent_id (e.g., mother_id, manager_id, parent_uuid). It converts "we'd have to migrate the table first" into "we can adopt now."
  • Roadmap sequencing: Low-risk, config-only surface area means hierarchy work can be scheduled early without committing to a schema convention that later migrations would have to unwind. Useful when the data model is still in flux.
  • Reduced migration scope: Where a rename to parent_id was previously a prerequisite, that migration can be dropped or deferred — a direct reduction in delivery risk and QA surface.
  • Multi-tenant / multi-domain modeling: Different domains can express parentage under domain-appropriate column names without forking the package or maintaining parallel implementations.

When to Consider This Package

Adopt when:

  • You need straightforward parent/child relationships (single parent per node) rather than arbitrary many-to-many graphs or deeply optimized nested-set reads.
  • Your existing tables use a non-standard parent column name, or you expect the naming convention to vary across models — this release specifically removes that friction.
  • You want the behavior encapsulated in a trait/base model rather than scattered recursive query code.
  • Your team is standardizing on Laravel conventions and prefers a small, single-purpose dependency over a larger tree/graph library.

Look elsewhere when:

  • You need frequent, deep subtree queries at scale (consider nested set or closure table implementations — adjacency lists require recursive CTEs or repeated queries).
  • You need multi-parent/DAG relationships, ordering/sort-position management, or move-and-reparent operations with heavy integrity guarantees.
  • The parent column name must be resolved dynamically at runtime per-record rather than per-model class — verify this release supports your case before committing.
  • Your schema is owned by another team or vendor and even a config-level assumption about column shape is unstable.

How to Pitch It (Stakeholders)

To executives: This is a small, focused library that gives us parent/child data structures — categories, org hierarchies, threaded content — without custom code we'd have to build and maintain. The 1.1.20 release adds a configuration option that lets it work with our existing database column names, which removes a migration from the critical path and lowers delivery risk. Cost is a single lightweight dependency; the alternative is several days of bespoke implementation plus ongoing ownership.

To engineering: Version 1.1.20 exposes parentColumn('parent_column_name') on the model, so the parent foreign key is configurable per model instead of hard-coded to the default. Low blast radius — it's a configuration method, not a behavioral change, and existing models are unaffected unless they opt in. Recommend we validate it against our legacy tables in a spike before we rely on it, and confirm behavior under eager loading and recursive traversal.

Recommendation: Adopt for adjacency-list use cases; treat the configurable parent column as the enabling factor for our legacy-schema integration, and gate broader rollout on a short validation spike.

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.
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus