title: Laravel - Check if value is present in array
body: <p>Why does this code return false every time?</p>
  
  <pre><code>$lics = collect(['lic100' =&gt; auth()-&gt;user()-&gt;lic100, 'lic250' =&gt; auth()-&gt;user()-&gt;lic250, 'lic500' =&gt; auth()-&gt;user()-&gt;lic500]);
  $licsowned = $lics-&gt;filter()-&gt;keys();
  $haslicense = property_exists($licsowned, $data['lictype']);
  </code></pre>
  
  <p>$licsowned:</p>
  
  <pre><code>Illuminate\Support\Collection {#367 ▼
   #items: array:3 [▼
    0 =&gt; "lic100"
    1 =&gt; "lic250"
    2 =&gt; "lic500"
   ]
  }
  </code></pre>
  
  <p>$data['lictype'] has the value <code>lic250</code></p>
  
  <p>I also tried with in_array() but it gave the error message that the value must be an array and I passed an object.</p>