public function getFeed() { $feed = Feed::make(); //$feed->clearCache(); $feed->setCache(180, 'shantavo-feed'); if (!$feed->isCached()) { $pictures = Picture::orderBy('uploaded_at', 'desc')->take(20)->get(); $feed->title = 'Нещо Шантаво'; $feed->description = 'Последни снимки'; $feed->link = 'https://neshto.shantavo.com/'; $feed->logo = "https://neshto.shantavo.com/favicon.png"; $feed->icon = "https://neshto.shantavo.com/favicon.png"; $feed->pubdate = $pictures[0]->uploaded_at; $feed->lang = 'bg'; $feed->setDateFormat('datetime'); foreach ($pictures as $picture) { $feed->add($picture->title, $picture->user->username, secure_url('picture/' . $picture->id), $picture->uploaded_at, $picture->title, $picture->title); } } return $feed->render('atom'); }
public function getNew() { $pictures = Picture::orderBy('uploaded_at', 'DESC')->paginate(12); // layouts variables $this->layout->title = 'Последно качени | Нещо Шантаво'; $this->layout->canonical = 'https://neshto.shantavo.com/category/new'; $this->layout->robots = 'index,follow,noodp,noydir'; $this->layout->description = 'Това е началната страница'; $this->layout->keywords = 'начало, нещо шантаво, team navy pier'; // nesting the view into the layout $this->layout->nest('content', 'category.new', array('pictures' => $pictures)); }