1 public function getYearlyVisits()
2 {
3 $monthlyVisitors = DB::table('shorteners')
4 ->select([
5 DB::raw('YEAR(created_at) as year'),
6 DB::raw('count(total_visits as total_visits'),
7 ])
8 ->groupBy('year')
9 ->get();
10 }
11