/** * Generates a Rss feed of all incidents. * * @param \CachetHQ\Cachet\Models\ComponentGroup|null $group * @param bool $isRss * * @return \Illuminate\Http\Response */ private function feedAction(ComponentGroup &$group, $isRss) { if ($group->exists) { $group->components->map(function ($component) { $component->incidents()->visible()->orderBy('created_at', 'desc')->get()->map(function ($incident) use($isRss) { $this->feedAddItem($incident, $isRss); }); }); } else { Incident::visible()->orderBy('created_at', 'desc')->get()->map(function ($incident) use($isRss) { $this->feedAddItem($incident, $isRss); }); } return $this->feed->render($isRss ? 'rss' : 'atom'); }
/** * Returns aggregated feed with all items from $items array * * @param string $format (options: 'atom', 'rss') * @param \Roumen\Feed\carbon|\Roumen\Feed\datetime|integer $cache (0 - turns off the cache) * @return \Roumen\Feed\view * @static */ public static function render($format = 'atom', $cache = 0, $key = 'laravel-feed') { return \Roumen\Feed\Feed::render($format, $cache, $key); }