public function onStart() { $this['posts'] = Post::isPublished()->orderBy('published_at', 'desc')->take(2)->get(); }
protected function loadPost() { $slug = $this->property('slug'); $post = NewsPost::isPublished()->where('slug', $slug)->first(); return $post; }