/** * Show tree , use send data from client ajax * @param [int] $id * @return void */ public function showTree($id) { $features = Feature::where('module_id', '=', $id)->where('parent_id', '=', 0)->get(); if (count($features) == 0) { echo ""; } else { echo "<table class='tree table'>"; foreach ($features as $k_fea => $val_fea) { echo "<tr class='treegrid-" . $val_fea->id . "'><td>" . $val_fea->name_feature . "</td></tr>"; $items = FeatureNode::descendantsOf($val_fea->id); $items->linkNodes(); $items = $items->toTree(); echo $this->echoRecurTreeView($items); } echo "</table>"; } }