title: Laravel query whereIn - show results from which search
body: <p>I have an array that comes to controller's action.</p>
  
  <pre><code>$arrOfTags = $request['position'];
  </code></pre>
  
  <p>That array looks like : </p>
  
  <pre><code>['manager', 'consultant'];
  </code></pre>
  
  <p>Next, I am querying the DB for CV's where position is one of these.</p>
  
  <pre><code>$query = Cv::query();
  $query-&gt;whereIn('position', $arrOfTags);
  ...
  -&gt;get();
  </code></pre>
  
  <p>Now the question : 
  If <code>$request['position'] = ['manager','consultant'];</code> and <code>whereIn</code> clause finds result just for <code>position = 'consultant'</code> and none for <code>'manager'</code>, how can I programmatically discover that results are found for <code>'consultant'</code> and/or didn't found for <code>'manager'</code> ?</p>
  
  <p> EDIT</p>
  
  <p>All my query's code : </p>
  
  <pre><code>$arrOfTags = explode(',', $request['position']);
  $query = Cv::query();
          $query-&gt;whereIn('position', $arrOfTags)
   if($request['salary']) {
              $query-&gt;whereIn('salary', $request['salary']);
          }
  
          if($request['skill']) {
              $query-&gt;join('skills', 'cvs.id', '=', 'skills.cv_id')
                    -&gt;join('allskills', 'skills.allskills_id', '=', 'allskills.id')
                    -&gt;select('cvs.*', 'allskills.name AS skillName')
                    -&gt;whereIn('skills.allskills_id', $request['skill']);
          }
  
          if($request['language']) {
              $query-&gt;join('languages', 'cvs.id', '=', 'languages.cv_id')
                    -&gt;join('alllanguages', 'languages.alllanguages_id', '=', 'alllanguages.id')
                    -&gt;select('cvs.*', 'alllanguages.name as languageName')
                    -&gt;whereIn('languages.alllanguages_id', $request['language']);
          }
  
          $cvs = $query-&gt;distinct()-&gt;get();
  </code></pre>
  
  <blockquote>
    <p>Imagine that $arrOfTags values are <code>['manager', 'consultant', 'sales']</code></p>
    
    <p>I want somehow to discover that results was found for <code>position =</code>
    <code>manager and consultant</code>, and didn't found for <code>position = 'sales'</code></p>
  </blockquote>