Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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();
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #yearly #chart #laravel
ADD COMMENT
Topic
Name
9+4 =