From 82a8c42d9aab6b225270af4256111af92543883b Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:27:47 +0200 Subject: [PATCH] fix(clears-global-search-cache): refine team retrieval logic in getTeamIdForCache method - Updated the getTeamIdForCache method to differentiate team retrieval based on the instance type, ensuring correct access to the team property or method for Server models and other types. --- app/Traits/ClearsGlobalSearchCache.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; }