I am trying to find the number of user with WhereIN query, I tested with three types 1st two return user correctly but when I use the variable instead of direct data then it returns null
$userss = User::where('id',Auth::user()->id)->first();
$membership = Ppv::whereIN('membership_id',[3])->count();
dd( $membership);//its returns user correctly
$membership = Ppv::where('membership_id',$userss->membership_id)->count();
dd( $membership); // also return users correctly
but when i use it in whereIN query it returns null
$userss = User::where('id',Auth::user()->id)->first();
$membership = Ppv::whereIN('membership_id',array($userss->membership_id))->count();
dd( $membership); // retruns null or 0
whereIn()and notwhereIN()?whereInfor an array with one item.