title: Filter by month with format 'Y-m-d'
body: <p>i have a <code>date</code> with format <code>Y-m-d</code>. How can i filter it by month? I specified the month by numbers like <code>January = 1, February = 2</code> and so and so forth.</p>
  
  <pre><code>public function scopegetmonthleavereport($query,$payroll_employee_id,$month)
  {
  
           $query-&gt;join('tbl_payroll_leave_employee_v2','tbl_payroll_leave_schedulev2.payroll_leave_employee_id','=','tbl_payroll_leave_employee_v2.payroll_leave_employee_id')
           -&gt;join("tbl_payroll_employee_basic","tbl_payroll_leave_employee_v2.payroll_employee_id","=","tbl_payroll_employee_basic.payroll_employee_id")
           -&gt;join("tbl_payroll_leave_tempv2","tbl_payroll_leave_employee_v2.payroll_leave_temp_id","=","tbl_payroll_leave_tempv2.payroll_leave_temp_id")
           -&gt;select(DB::raw('tbl_payroll_employee_basic.payroll_employee_id , tbl_payroll_leave_schedulev2.payroll_schedule_leave, tbl_payroll_employee_basic.payroll_employee_display_name, tbl_payroll_leave_schedulev2.payroll_leave_temp_with_pay, tbl_payroll_leave_tempv2.payroll_leave_type_id, tbl_payroll_leave_employee_v2.payroll_leave_employee_id, tbl_payroll_leave_schedulev2.consume, tbl_payroll_leave_employee_v2.payroll_leave_temp_hours, sum(tbl_payroll_leave_schedulev2.consume) as total_leave_consume, (tbl_payroll_leave_employee_v2.payroll_leave_temp_hours - sum(tbl_payroll_leave_schedulev2.consume)) as remaining_leave'))
           -&gt;groupBy('tbl_payroll_leave_employee_v2.payroll_leave_temp_id')
           -&gt;where('tbl_payroll_leave_schedulev2.payroll_leave_schedule_archived',0)
           -&gt;where('tbl_payroll_leave_employee_v2.payroll_employee_id', $payroll_employee_id)
           -&gt;whereBetween('tbl_payroll_leave_schedulev2.payroll_schedule_leave', $date);  //where i want to put the date
  
  
      return $query;
  }
  </code></pre>