编辑代码

<?php 
 /**
     *  左则目录导航
     */
    protected function treeView() {

        return new Tree(ApiTester::class, function (Tree $tree) {
            $tree->query(function ($model) {
                $proj_id = Request()->get('proj_id');
                return $model->where('proj_id', $proj_id);
            });
            $tree->disableCreateButton();
            $tree->disableQuickCreateButton();
            $tree->disableEditButton();
            $tree->maxDepth(3);// 可以嵌套的层级 最多3级

            $tree->actions(function (Tree\Actions $actions) {
                //$actions->edit(false);
                $actions->prepend(new EditApiInfo());
                $actions->disableEdit();
                $actions->disableQuickEdit();
                //$actions->disableDelete();
            });

            $tree->branch(function ($branch) {
                $payload = "&nbsp;<strong>{$branch['title']}</strong>";

                if (!isset($branch['children'])) {
                    if (url()->isValidUrl($branch['uri'])) {
                        $uri = $branch['uri'];
                    } else {
                        $uri = admin_base_path($branch['uri']);
                    }
                    $uri     = Str::limit($uri, 10);
                    $payload .= "&nbsp;&nbsp;&nbsp;<a href=\"$uri\" class=\"dd-nodrag\">$uri</a>";
                }

                return $payload;
            });
        });
    }