|
|
@@ -3,12 +3,12 @@
|
|
|
use Illuminate\Support\Facades\Lang;
|
|
|
|
|
|
if (!function_exists('list_to_tree')) {
|
|
|
- function list_to_tree($elements, $parentKey = "parent_id", $parentId = 0):array
|
|
|
+ function list_to_tree($elements, $parentKey = "parent_id", $parentId = 0): array
|
|
|
{
|
|
|
$branch = [];
|
|
|
foreach ($elements as $element) {
|
|
|
if ($element[$parentKey] == $parentId) {
|
|
|
- $children = list_to_tree($elements, $element['id']);
|
|
|
+ $children = list_to_tree($elements, $parentKey, $element['id']);
|
|
|
if ($children) {
|
|
|
$element['children'] = $children;
|
|
|
}
|