Skip to content

Commit 2fda852

Browse files
authored
Update Tree.php
1 parent 99209dc commit 2fda852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Utils/Tree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Tree
1414
*/
1515
public static function toTree($data = [], $primary = 'id', $parent = 'parent_id', $children = 'children')
1616
{
17-
if (!isset($data[0][$parent])) {
17+
if (count($data) === 0) {
1818
return [];
1919
}
2020

0 commit comments

Comments
 (0)