bundle->getPath() === '/') { $baseRender['/index.xml'] = $this->renderFeed(); } return $baseRender; } /** * Return a boolean value indicating if this creator in particular can * create bundles for specified section */ public static function handles(Bundle $bundle): bool { // This renderer is used by default when no other renderer claimed it // can handle the path return false; } private function renderFeed() { $bundles = $this->getSubBundles(); $lastBundles = array_map( function ($item) { $bundle = new Bundle($item, $this->bundle->getDisk()); $bundle->load(); return $bundle; }, array_slice($bundles, 0, 10) ); $lastBundle = collect($lastBundles)->first(); return (string) view('feed', [ 'bundles' => $lastBundles, 'lastBuildDate' => Carbon::parse($lastBundle->metadata()->get('date')), ]); } }