public function scopeByYearMonth($query, $year, $month)
	{
		return $query->where(\DB::raw('DATE_FORMAT(published_date, "%Y%m")'), '=', $year.$month);
	}
public function scopeByYearMonth($query, $year, $month)
	{
		return $query->where(\DB::raw('DATE_FORMAT(published_date, "%Y%m")'), '=', $year.$month);
	}
public function scopeByYearMonth ( $ query , $ year , $ month ) { return $ query -> where ( \ DB :: raw ( 'DATE_FORMAT(published_date, "%Y%m")' ) , '=' , $ year . $ month ) ; }
Query scope for posts published within the given year and month number.

@param $query
@param $year
@param $month
@return mixed
Query scope for posts published within the given year and month number .