@CRONIX - Ok I think I figured out the best way to go about this.
No I just need to figure out is how to do a ->where('time'(in unix timestamp),$date->copy()->format('m'))
something like:
$this_months_values = (new $propdash->custommenuitems->monthly_real_time_feed)::where('time',$date->copy()->format('m'))->sum('data');
So far i'm down to this:
$date = Carbon::today();
/* Yearly Realtime Consumption data feed */
$this_months_values = (new $propdash->custommenuitems->monthly_real_time_feed)::where('time',$date->copy()->format('m'))->sum('data');
$one_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$two_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$three_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$four_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$five_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$six_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$seven_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$eight_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$nine_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$ten_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
$eleven_month_agos_values = (new $propdash->custommenuitems->monthly_real_time_feed)::sum('data');
/* Create the chart */
$yearly_consumption_chart = new HighCharts;
$yearly_consumption_chart->labels([
$date->copy()->subMonths(11)->format('F'),
$date->copy()->subMonths(10)->format('F'),
$date->copy()->subMonths(9)->format('F'),
$date->copy()->subMonths(8)->format('F'),
$date->copy()->subMonths(7)->format('F'),
$date->copy()->subMonths(6)->format('F'),
$date->copy()->subMonths(5)->format('F'),
$date->copy()->subMonths(4)->format('F'),
$date->copy()->subMonths(3)->format('F'),
$date->copy()->subMonths(2)->format('F'),
$date->copy()->subMonths(1)->format('F'),
$date->copy()->format('F')]);
$yearly_consumption_chart->dataset('kWh', 'line', [$eleven_month_agos_values,
$ten_month_agos_values,$nine_month_agos_values,$eight_month_agos_values,
$seven_month_agos_values,$six_month_agos_values,$five_month_agos_values,$four_month_agos_values,
$three_month_agos_values,$two_month_agos_values,$one_month_agos_values,$this_months_values]);