예제 #1
0
 private function getRSS($type)
 {
     $key = $type . '_rss_feed_';
     if (Cache::has($key)) {
         return Cache::get($key);
     }
     if ($type == 'mp3') {
         $objs = MP3::published()->latest()->take(10)->get();
         $hash = 'Mizik';
     } elseif ($type == 'mp4') {
         $objs = MP4::latest()->take(10)->get();
         $hash = 'Videyo';
     }
     $rss = $this->buildRssData($objs, $type, $hash);
     $rss = Response::make($rss)->header('Content-type', 'application/rss+xml');
     Cache::put($key, $rss, 30);
     return $rss;
 }