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.
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."parent_id was previously a prerequisite, that migration can be dropped or deferred — a direct reduction in delivery risk and QA surface.Adopt when:
Look elsewhere when:
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.
How can I help you explore Laravel packages today?