/** * Display a listing of the resource. * * @param Request $r * @return \Illuminate\Http\Response */ public function index(Request $r) { $withChildren = (bool) $r->get('withChildren', false); if ($withChildren) { $root = Node::all()->toHierarchy(); } else { $root = Node::roots()->get(); } return Response::json($root); }
public function index() { $nodes = Node::all(); return $this->view()->assign('nodes', $nodes)->display('admin/node.tpl'); }
public function node() { $nodes = Node::all(); return $this->view()->assign('nodes', $nodes)->display('user/node.tpl'); }
public function index($request, $response, $args) { $nodes = Node::all(); return $this->view()->assign('nodes', $nodes)->display('admin/node/index.tpl'); }