diff --git a/src/Franzose/ClosureTable/Models/Entity.php b/src/Franzose/ClosureTable/Models/Entity.php index bed5e37..8cdeb6b 100644 --- a/src/Franzose/ClosureTable/Models/Entity.php +++ b/src/Franzose/ClosureTable/Models/Entity.php @@ -1106,7 +1106,7 @@ public static function getTree(array $columns = ['*']) */ $instance = new static; - return $instance->orderBy('parent_id')->orderBy('position') + return $instance->orderBy($instance->getParentIdColumn())->orderBy($instance->getPositionColumn()) ->get($instance->prepareTreeQueryColumns($columns))->toTree(); }