Esempio n. 1
0
 /**
  * Find a post by it's slug.
  *
  * @param $post
  * @return null|PostInterface
  */
 public function findBySlug($slug)
 {
     return $this->model->orderBy('created_at', 'DESC')->where('slug', $slug)->first();
 }
Esempio n. 2
0
 /**
  * Find many posts by category.
  *
  * @param CategoryInterface $category
  * @param null              $limit
  * @return EntryCollection
  */
 public function findManyByCategory(CategoryInterface $category, $limit = null)
 {
     return $this->model->orderBy('created_at', 'DESC')->where('category_id', $category->getId())->paginate($limit);
 }