vendredi 29 juillet 2016

How to display selected values from database to graphs

Actually i wanted to display 5 largest values from a column numberofclick in my database and create graphs for these top 5 data and also when howered shows id from id column so far i have done this....... im using laravel 5.2 and chart.js this is my controller

$click = Click::select(DB::raw("(numberofclick) as count"))

    ->orderBy("numberofclick")

    ->groupBy(DB::raw("(numberofclick)"))

    ->get()->toArray(); 

$click = array_column($click, 'count');



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire