title: Relationship "doesntHave" doesnt work in Laravel
body: <p>I need help. I have a problem. In this part of the code Relationship &quot;doesntHave&quot; doesnt work and return full list of the users</p>
  <pre><code>$searchData = $request-&gt;searchData;
  $users = User::doesntHave('roles')
      -&gt;where('id','like', '%' . $searchData . '%')
      -&gt;orWhere('name', 'like', '%' . $searchData . '%')
      -&gt;orWhere('email', 'like', '%' . $searchData . '%')
      -&gt;limit(8)
      -&gt;get();
         
  return response()-&gt;json($users);
  </code></pre>