src/Models/Tree.php
public function getRoot($columns = ['*'])
	{
		$columns = $this->formatColumns($columns);
		$node = $this;
		if (empty($this->pathKey))
		{
			while(!empty($node->getParentKey()))
				$node = $this->getNode($node->getParentKey(), $columns);
			return $node;
		} else {
			list(,,$rootid) = explode('/', $node->getPathKey()); // [/0/1/2/3/] => 1
			return $this->getNode($rootid, $columns);
		}
	}
public function getRoot($columns = ['*'])
	{
		$columns = $this->formatColumns($columns);
		$node = $this;
		if (empty($this->pathKey))
		{
			while(!empty($node->getParentKey()))
				$node = $this->getNode($node->getParentKey(), $columns);
			return $node;
		} else {
			list(,,$rootid) = explode('/', $node->getPathKey()); // [/0/1/2/3/] => 1
			return $this->getNode($rootid, $columns);
		}
	}
获取所匹配的根节点Node

@return mixed      得到root