laravel count() code example

Example 1: get count laravel

$count = Model::where('status','=','1')->count();

Example 2: count in laravel'

$count = ModelName::where('id',$id)->count();

Example 3: laravel wher in

$users = DB::table('users')
                    ->whereIn('id', [1, 2, 3])
                    ->get();

Example 4: laravel select count

$count = DB::table('category_issue')->count();

Example 5: count with condition laravel

$user = User::where('user_id' , 10);
$user->count();

Example 6: check count in laravel

$wordlist = Wordlist::where('id', '<=', $correctedComparisons)->get();
$wordCount = $wordlist->count();