samedi 6 février 2021

Sort array from days Laravel 5.8

I want to sort an array according to the days name order. here is my array comes from query result.

        $data = DB::table('jobs')
                ->select('day', DB::raw('count(*) as count'))
                ->groupBy('day')
                ->get()->toArray();

Output is:

enter image description here

I send this data to draw a bar chart with chart.js , so I want to sort this array from Monday to Friday. I'm new to laravel. please help me to solve this. thank you in advance.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3jmieu1
via IFTTT

Aucun commentaire:

Enregistrer un commentaire