From 262a1eac4a20e787ce7e01f9ff6ca6687378d748 Mon Sep 17 00:00:00 2001 From: Marcel Pociot Date: Fri, 19 Jun 2020 09:13:26 +0200 Subject: [PATCH] Use toArray representation of sites for the server. Fixes #44 --- app/Server/Http/Controllers/Admin/ListSitesController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Server/Http/Controllers/Admin/ListSitesController.php b/app/Server/Http/Controllers/Admin/ListSitesController.php index 80d4e9b..8e23976 100644 --- a/app/Server/Http/Controllers/Admin/ListSitesController.php +++ b/app/Server/Http/Controllers/Admin/ListSitesController.php @@ -25,7 +25,12 @@ public function handle(Request $request, ConnectionInterface $httpConnection) $sites = $this->getView($httpConnection, 'server.sites.index', [ 'scheme' => $this->configuration->port() === 443 ? 'https' : 'http', 'configuration' => $this->configuration, - 'sites' => $this->connectionManager->getConnections(), + 'sites' => collect($this->connectionManager->getConnections())->map(function ($site, $siteId) { + $site = $site->toArray(); + $site['id'] = $siteId; + + return $site; + })->values(), ]); $httpConnection->send(