public function all()
{
if ($this->streams === null) {
$this->streams = Cache::remember('livestreams', 5, function () {
return $this->download()->streams ?? [];
});
}
return $this->streams;
}
public function index() { view()->share('current_action', 'getLive'); $livestream = new LivestreamCollection(); $streams = $livestream->all(); $featuredStream = $livestream->featured(); return view('livestreams.index', compact('streams', 'featuredStream')); }