Skip to content

Commit 51f353c

Browse files
committed
Minor docs changes
1 parent 55fbea9 commit 51f353c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

CHANGELOG.markdown

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
- `insertAfter` to `insertAfterNode`
88
- `getNext` to `getNextNode`
99
- `getPrev` to `getPrevNode`
10-
1110
* #82: Fixing tree now handles case when nodes pointing non-existing parent
1211
* The number of missing parent is now returned when using `countErrors`
1312
* #79: implemented scoping feature

README.markdown

+17-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ __Contents:__
2121
- [Documentation](#documentation)
2222
- [Inserting nodes](#inserting-nodes)
2323
- [Retrieving nodes](#retrieving-nodes)
24-
- [Scoping](#scoping)
24+
- [Deleting nodes](#deleting-nodes)
2525
- [Consistency checking & fixing](#checking-consistency)
26+
- [Scoping](#scoping)
2627
- [Requirements](#requirements)
2728
- [Installation](#installation)
2829

@@ -189,6 +190,9 @@ $node = Category::create([
189190

190191
#### Ancestors
191192

193+
Ancestors make a chain of parents to the node. Helpful for displaying breadcrumbs
194+
to the current category.
195+
192196
```php
193197
// #1 Using accessor
194198
$result = $node->getAncestors();
@@ -202,6 +206,9 @@ $result = Category::ancestorsOf($id);
202206

203207
#### Descendants
204208

209+
Descendants are all nodes in a sub tree, i.e. children of node, children of
210+
children, etc.
211+
205212
```php
206213
// #1 Using relationship
207214
$result = $node->descendants;
@@ -213,8 +220,16 @@ $result = $node->descendants()->get();
213220
$result = Category::descendantsOf($id);
214221
```
215222

223+
Descendants can be eagerly loaded:
224+
225+
```php
226+
$nodes = Category::with('descendants')->whereIn('id', $idList)->get();
227+
```
228+
216229
#### Siblings
217230

231+
Siblings are nodes that have same parent.
232+
218233
```php
219234
$result = $node->getSiblings();
220235

@@ -374,7 +389,7 @@ This will output something like this:
374389
- Another root
375390
```
376391

377-
##### Getting subtree
392+
##### Getting a subtree
378393

379394
Sometimes you don't need whole tree to be loaded and just some subtree of specific node.
380395
It is show in following example:

0 commit comments

Comments
 (0)