svelte->render( layout: "channel", view: "homeIndex", title: "Records", ); } public function records(Request $request): Response { $urlParams = $request->all(); $users = $this->accountService->all(); $sort = data_get($urlParams, "sort") ?? "-_sys.updatedAt"; $filter = data_get($urlParams, "filter") ?? []; $arguments = array_merge([ "schema_in" => $this->accountService->currentReadableSchemas(), "status_in" => ["draft", "published"] ], $filter); $limit = 20; $graph = $this->query ->filter($arguments) ->limit($limit) ->childrenDepth(1) ->parentsDepth(0) ->sort($sort) ->run(); return ok([ "users" => $users, "records" => $graph->getRootRecords()->toArray(), "graph" => toArray($graph), "modalUrl" => $request->fullUrl(), ]); } }