Answers for "how to get yearly chart in laravel"

PHP
0

how to get yearly chart in laravel

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();
    }
Posted by: Guest on May-17-2021

Code answers related to "how to get yearly chart in laravel"

Browse Popular Code Answers by Language