diff --git a/app/Traits/ClearsGlobalSearchCache.php b/app/Traits/ClearsGlobalSearchCache.php index 306e4b2e1..ae587aa87 100644 --- a/app/Traits/ClearsGlobalSearchCache.php +++ b/app/Traits/ClearsGlobalSearchCache.php @@ -66,7 +66,11 @@ trait ClearsGlobalSearchCache { // For database models, team is accessed through environment.project.team if (method_exists($this, 'team')) { - $team = $this->team; + if ($this instanceof \App\Models\Server) { + $team = $this->team; + } else { + $team = $this->team(); + } if (filled($team)) { return is_object($team) ? $team->id : null; }