How To Get Yearly Chart In Laravel

[Solved] How To Get Yearly Chart In Laravel | Php - Code Explorer | yomemimo.com
Question : how to get yearly chart in laravel

Answered by : horrible-hamerkop-57ye55teboy8

 public function getYearlyVisits() { $monthlyVisitors = DB::table('shorteners') ->select([ DB::raw('YEAR(created_at) as year'), DB::raw('count(total_visits as total_visits'), ]) ->groupBy('year') ->get(); }

Source : https://stackoverflow.com/questions/56748390/how-separate-data-yearly-monthly-or-weekly | Last Update : Mon, 24 May 21

Answers related to how to get yearly chart in laravel

Code Explorer Popular Question For Php