count with condition code example
Example 1: condition in count sql
select count(case Position when 'Manager' then 1 else null end)
from ...
select sum(case Position when 'Manager' then 1 else 0 end)
from ...
Example 2: count with condition laravel
$user = User::where('user_id' , 10);
$user->count();