{"repo":"franzose/ClosureTable","free":true,"listed":false,"github":"https://github.com/franzose/ClosureTable","clone":"git clone https://github.com/franzose/ClosureTable.git","description":"Adjacency List’ed Closure Table database design pattern implementation for the Laravel framework.","language":"PHP","stars":463,"topics":["laravel","php","database","hierarchical-data","tree","closure-table"],"license":"MIT","category":"databases-storage","readme_excerpt":"ClosureTable This is a database manipulation package for the Laravel 5.4+ framework. You may want to use it when you need to store and operate hierarchical data in your database. The package is an implementation of a well-known design pattern called closure table. However, in order to simplify and optimize SQL SELECT queries, it uses adjacency lists to query direct parent/child relationships. Contents: - Installation - Setup - Requirements - Examples → List of Scopes - Examples → Parent/Root - Examples → Ancestors - Examples → Descendants - Examples → Children - Examples → Siblings - Examples → Tree - Examples → Collection Methods Installation It's strongly recommended to use Composer to install the package: If you use Laravel 5.5+, the package's service provider is automatically registered for you thanks to the package auto-discovery feature. Otherwise, you have to manually add it to your config/app.php : Setup In a basic scenario, you can simply run the following command: Where Node is the name of the entity model. This is what you get from running the above: 1. Two models in the app directory: App\\Node and App\\NodeClosure 2. A new migration in the database/migrations directory As you can see, the command requires a single argument, name of the entity model. However, it accepts several options in order to provide some sort of customization: Option Alias Meaning ---------------- ------ ------- namespace ns Custom namespace for generated models. Keep in mind that the given na","default_branch":null,"files":null,"tree":[],"storefront":"/r/franzose","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/franzose/ClosureTable/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}