Solution:
after a long search i was able to found the solution for my problem.
- monogdb uses different type queries for filtering for boolean values.for better understanding you can read this article. https://www.tutorialspoint.com/mongodb-query-for-boolean-field-as-not-true
- whereRaw works in case when directly searched with employee collection , but when we use it after whereHas query it does not worked.
so the query which works for me
$filterdata = Employee::whereRaw(['has_pp'=>['$eq'=>false]]);
or
$filterdata = Employee::whereRaw(['has_pp'=>['$ne'=>false]]);
$eq = equalto , $ne = not equal to syntax as per mongodb.
But still i am not able to understand the reason behind why WhereRaw does not works with WhereHas as per my previous query. if you guys understand the reason please do share.