*/ public function fetchTeams(): Collection { $cacheEnabled = setting('enable_caching') === '1'; if (Cache::has('hotel_teams') && $cacheEnabled) { /** @var Collection */ return Cache::get('hotel_teams'); } /** @var Collection $teams */ $teams = WebsiteTeam::where('is_active', true) ->orderBy('name') ->get(); if ($cacheEnabled) { $cacheTimer = (int) setting('cache_timer'); Cache::put('hotel_teams', $teams, now()->addMinutes($cacheTimer)); } return $teams; } }