Answers for "get count of entries from db efficiently laravel"

PHP
7

get count laravel

$count = Model::where('status','=','1')->count();
Posted by: Guest on May-12-2020
0

laravel count data wise

$usersData = User::select(DB::raw('DATE(created_at) as date'), DB::raw('count(*) as total'))
            ->groupBy('date')
            ->orderBy('date', 'desc')
            ->take(7)
            ->get();
Posted by: Guest on July-07-2021

Browse Popular Code Answers by Language