Skip to content

Commit

Permalink
fix: error when on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
olwalkey committed Dec 31, 2024
1 parent 0a29ce6 commit 2e18753
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}

0 comments on commit 2e18753

Please sign in to comment.