I'm trying to get logs from the last 24 hours for a chart I'm building. I'm using Laravel 5.8.
I need 1 line per every 15 minutes for the chart to be accurate.
The current state is one line per hour, I can't think of out to turn it into 15 minutes.
Please help me to make it work and make the code look as pretty as possible!
public function getDataDay(&$data) {
$data = $data->where('created_at', '>', Carbon::now()->subHours(23)->format('Y-m-d H:i:s'))
->select('id', 'part_id', 'data', 'created_at')
->selectRaw('HOUR(created_at) as hour')
->groupBy('hour')
->get();
}