title: YEAR(begin_date) unknown column in laravel
body: <pre>SELECT COUNT(*) as count, MONTH(begin_date)
  FROM `events`
  WHERE (YEAR(begin_date) = YEAR(CURDATE())) 
        OR (YEAR(begin_date) = YEAR(CURDATE()) + 1)  
  GROUP BY MONTH(begin_date)
  </pre>
  
  <p>Here is sql query, i want to write it in laravel eloquent.</p>
  
  <p>what i try:</p>
  
  <pre>
    $oncoming_events = DB::table('events')    
          ->select(DB::raw('count(*) as numOfOncomingEvents, MONTH(begin_date)'))    
      ->where('YEAR(begin_date)', '=',  'YEAR(CURDATE())')
      ->orWhere('YEAR(begin_date)', '=', 'YEAR(CURDATE()) +1')
      ->groupBy('MONTH(begin_date)')->get();
  </pre>
  
  <p>Error: </p>
  
  <blockquote>
    <p>SQLSTATE[42S22]: Column not found: 1054 Unknown column 'YEAR(begin_date)' in 'where clause' (SQL: select count(*) as numOfOncomingEvents, MONTH(begin_date) from <code>events</code> where <code>YEAR(begin_date)</code> = </p>
  </blockquote>
  
  <p>laravel 5.6</p>
  
  <p>btw 
  sql query works..</p>