posts as $post) { $year = $post->date->year; $month = $post->date->month; $day = $post->date->day; $item = array(); $item['uri'] = sprintf('https://www.executeprogram.com/blog/%s', $post->slug); $item['title'] = $post->title; $dateTime = \DateTime::createFromFormat('Y-m-d', $year . '-' . $month . '-' . $day); $item['timestamp'] = $dateTime->format('U'); $item['content'] = $post->body; $this->items[] = $item; } usort($this->items, function ($a, $b) { return $a['timestamp'] < $b['timestamp']; }); } public function getIcon() { return 'https://www.executeprogram.com/favicon.ico'; } }