app\models\LivestreamCollection::all PHP Метод

all() публичный Метод

public all ( )
    public function all()
    {
        if ($this->streams === null) {
            $this->streams = Cache::remember('livestreams', 5, function () {
                return $this->download()->streams ?? [];
            });
        }
        return $this->streams;
    }

Usage Example

Пример #1
0
 public function index()
 {
     view()->share('current_action', 'getLive');
     $livestream = new LivestreamCollection();
     $streams = $livestream->all();
     $featuredStream = $livestream->featured();
     return view('livestreams.index', compact('streams', 'featuredStream'));
 }