We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b868b70 commit 1ab2ac7Copy full SHA for 1ab2ac7
src/Baum/Node.php
@@ -500,8 +500,9 @@ public function scopeWithoutRoot($query) {
500
public function scopeLimitDepth($query, $limit) {
501
$depth = $this->exists ? $this->getDepth() : $this->getLevel();
502
$max = $depth + $limit;
503
+ $scopes = array($depth, $max);
504
- return $query->whereBetween($this->getDepthColumnName(), array($depth, $max));
505
+ return $query->whereBetween($this->getDepthColumnName(), array(min($scopes), max($scopes)));
506
}
507
508
/**
0 commit comments