From 925aa59032dbbea6e471f3f1327041e513732ba2 Mon Sep 17 00:00:00 2001 From: Jan Iwanow Date: Sun, 18 May 2014 17:43:06 +1100 Subject: [PATCH] fixed #82, added basic ascending ordering to getTree method --- src/Franzose/ClosureTable/Models/Entity.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Franzose/ClosureTable/Models/Entity.php b/src/Franzose/ClosureTable/Models/Entity.php index d10db73..84a6f94 100644 --- a/src/Franzose/ClosureTable/Models/Entity.php +++ b/src/Franzose/ClosureTable/Models/Entity.php @@ -1127,7 +1127,8 @@ public static function getTree(array $columns = ['*']) */ $instance = new static; - return $instance->get($instance->prepareTreeQueryColumns($columns))->toTree(); + return $instance->orderBy('parent_id')->orderBy('position') + ->get($instance->prepareTreeQueryColumns($columns))->toTree(); } /**