title: Use where function in a Laravel Collection
body: <p>I have a array config with designs and each design correspond to a main tag category but some designs have two main tags for example pokemon + game of thrones:</p>
  
  <pre><code>'b5u8ic66ywua' =&gt; array(
          'design_id'     =&gt; 'b5u8ic66ywua',
          'design_name' =&gt; 'choose dragon blanket',
          'main_tag'    =&gt; 'pokemon,game of thrones',
          'tags'        =&gt; array('pokemon','pixelart','game of thrones'),
          'article_owner' =&gt; '1426',
  
      ),
      'dx6nalh1bkk4' =&gt; array(
          'design_id'     =&gt; 'dx6nalh1bkk4',
          'design_name' =&gt; 'choose direwolf blanket',
          'main_tag'    =&gt; 'pokemon,game of thrones',
          'tags'        =&gt; array('pokemon','pixelart','game of thrones'),
          'article_owner' =&gt; '1426',
  
      ), 
      'ih91h1i77g9j' =&gt; array(
          'design_id'     =&gt; 'ih91h1i77g9j',
          'design_name'   =&gt; 'game of thrones pixelart',
          'main_tag'      =&gt; 'game of thrones',
          'tags'          =&gt; array('game of thrones','stark','jon snow','daenerys', 'danny','pixelart','game of thrones'),
          'article_owner' =&gt; '1426',
  
      ),
  
      'wolcf2m524nu' =&gt; array(
          'design_id'     =&gt; 'wolcf2m524nu',
          'design_name'   =&gt; 'starks revenge',
          'main_tag'      =&gt; 'game of thrones',
          'tags'          =&gt; array('game of thrones','stark','house stark','starks'),
          'article_owner' =&gt; '1426',
  
      ),
  </code></pre>
  
  <p>In this case, I want get all designs that contains the main tag as game of thrones, and create a collection with these designs.</p>
  
  <p>I´m using where function. For example, category_design_name in this case is 'game-of-thrones':</p>
  
  <pre><code>$family_article_designs = collect(config('artdesigns.'.$article_id))-&gt;where('main_tag',str_replace("-", " ", $category_design_name));
  
  $family_article_designs = $family_article_designs-&gt;all();
  </code></pre>
  
  <p>This return me the designs with only main_tag=game of thrones, but not return me the designs with more than one main_tag:</p>
  
  <pre><code>'ih91h1i77g9j' =&gt; array(
          'design_id'     =&gt; 'ih91h1i77g9j',
          'design_name'   =&gt; 'game of thrones pixelart',
          'main_tag'      =&gt; 'game of thrones',
          'tags'          =&gt; array('game of thrones','stark','jon snow','daenerys', 'danny','pixelart','game of thrones'),
          'article_owner' =&gt; '1426',
  
      ),
  
      'wolcf2m524nu' =&gt; array(
          'design_id'     =&gt; 'wolcf2m524nu',
          'design_name'   =&gt; 'starks revenge',
          'main_tag'      =&gt; 'game of thrones',
          'tags'          =&gt; array('game of thrones','stark','house stark','starks'),
          'article_owner' =&gt; '1426',
  
      ),
  </code></pre>
  
  <p>I want get all the designs, that contains in his the word 'game of thrones'.</p>
  
  <p>EDIT:</p>
  
  <pre><code>$family_article_designs = collect(config('artdesigns.'.'@'.$article_id))-&gt;filter(function ($value, $key) {
                              if(strpos($value['main_tag'], str_replace("-", " ", $category_design_name)) !== false)
                               return true;
                          });
  </code></pre>
  
  <p>This return me: <strong>Undefined variable: category_design_name</strong></p>