From 2e187539760ab4168f6c1541f245dab7d67d568a Mon Sep 17 00:00:00 2001 From: KalebSchmidlkofer Date: Tue, 31 Dec 2024 01:00:24 -0800 Subject: [PATCH] fix: error when on homepage --- app/Models/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 44dfdbf9b..4255c0bcd 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -266,11 +266,11 @@ public function activity(): MorphToMany public function accessibleServers(): Builder { return Server::query() - ->select('servers.*') + ->select('servers.id', 'servers.name', 'servers.owner_id') ->leftJoin('subusers', 'subusers.server_id', '=', 'servers.id') ->where(function (Builder $builder) { $builder->where('servers.owner_id', $this->id)->orWhere('subusers.user_id', $this->id); }) - ->groupBy('servers.id'); + ->groupBy('servers.id', 'servers.name', 'servers.owner_id'); } }