public function rss() { $posts = Post::isPublished()->orderBy('published_at', 'desc')->take(10)->get(); //TODO use options instead of take(10) ! $last_build_date = \DateTime::createFromFormat('Y-m-d H:i:s', Post::max('created_at'))->format('D, d M Y H:i:s O'); $content = view('blog::rss')->withPosts($posts)->withLastBuildDate($last_build_date)->withSiteName(Option::get('site_name')); return \Response::make($content, '200')->header('Content-Type', 'text/xml'); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $posts = Post::orderBy('created_at', 'desc')->paginate(10); return view('blog::admin.index')->withPosts($posts)->withCategories(Category::all())->withOptionRssName(Option::get('rss_name'))->withOptionRssNumber(Option::get('rss_number')); }