/** * Get all posts with matching title or content. * * @return Collection */ protected function posts() { return Post::with(['categories', 'featured_images'])->isPublished()->where('title', 'like', "%{$this->query}%")->orWhere('content', 'like', "%{$this->query}%")->orWhere('excerpt', 'like', "%{$this->query}%")->orderBy('published_at', 'desc')->get(); }