Example #1
0
 public function getByMonth($month, $year, $n)
 {
     $posts = BlogPost::with('category')->where(DB::raw('MONTH(created_at)'), '=', $month)->where(DB::raw('YEAR(created_at)'), '=', $year)->where('active', '=', 1)->orderBy('created_at', 'DESC')->paginate($n);
     return $posts;
 }