I am uploading data to a database in Mysql automatically with an arduino device, in my view I am showing this data, through a query in my controller
public function show($id)
{
$consumes = consume::where('user_id', $id)->get();
foreach ($consumes as $consume){
$fechas = $consume->created_at;
}
dd($fechas);
return view('user.consumo.show', [
'consumes'=>$consumes
]);
}
I'm working with laravel 5.5 I installed the carbon add-on since I need to automatically insert data by dates the problem is that in dates it does not keep all the dates only the last, do you know why and how can I save all of them?