I don’t know how can i use in my code , this is my code in my controller : public function viewArchives(){ $data = Archive::select(‘created_at’)->get(); return view(‘view.archives’, compact(‘data’)); } and in view : <?php echo $data;?> the result is : {“created_at”:”2019-03-17 19:10:30″} but i want the result be like this : {“created_at”:”1552849830″}
how can i do this? thanks
when i use dataPoints: <?php echo $data; ?> that shows to me like this : dataPoints:[{“x”:2019-03-17 17:48:05,”y”:100}] but i want to show like this for showing on chart: dataPoints:[{“x”:1483381800000,”y”:100}]}] i can’t see chart by this format : dataPoints:[{“x”:2019-03-17 17:48:05,”y”:100}]
hello i want to use created_at column on my chart as X , but it needs to be in unixtimestamp format , how can i get or convert date from database from date like this 2019-03-17 17:48:05 to 1553720114 format? thanks