lianhechx / laravel-nestedset by lianhechx

Nested Set Model for Laravel
34
0
1
Package Data
Maintainer Username: lianhechx
Maintainer Contact: lianhechx@gmail.com (Chen)
Package Create Date: 2017-01-24
Package Last Update: 2017-01-24
Language: PHP
License: MIT
Last Refreshed: 2024-12-11 15:10:08
Package Statistics
Total Downloads: 34
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

This is a Laravel package for working with trees in relational databases.

What are nested sets?

Nested sets or Nested Set Model is a way to effectively store hierarchical data in a relational table. From wikipedia:

The nested set model is to number the nodes according to a tree traversal, which visits each node twice, assigning numbers in the order of visiting, and at both visits. This leaves two numbers for each node, which are stored as two attributes. Querying becomes inexpensive: hierarchy membership can be tested by comparing these numbers. Updating requires renumbering and is therefore expensive.