query(); } return Cache::rememberForever($this->keyName, function () { return $this->query(); }); } /** * Query fresh data from the database. * * @return array */ private function query() { return [ 'albums' => Album::orderBy('name')->get(), 'artists' => Artist::orderBy('name')->get(), 'songs' => Song::all(), ]; } /** * Clear the media cache. */ public function clear() { Cache::forget($this->keyName); } }