title: Search value deeply nested within a Laravel Collection
body: <p>I have an Eloquent Collection just like this (dumped):</p>
  
  <pre><code>Collection {#788 ▼
    #items: array:3 [▼
      0 =&gt; Rating {#787 ▼
        #table: "ratings"
        +timestamps: false
        #connection: null
        #primaryKey: "id"
        #keyType: "int"
        #perPage: 15
        +incrementing: true
        #attributes: array:3 [▼
          "id" =&gt; 1
          "rating" =&gt; "50"
          "type" =&gt; "min"
        ]
        #original: array:3 [▶]
        #relations: []
        #hidden: []
        #visible: []
        #appends: []
        #fillable: []
        #guarded: array:1 [▶]
        #dates: []
        #dateFormat: null
        #casts: []
        #touches: []
        #observables: []
        #with: []
        #morphClass: null
        +exists: true
        +wasRecentlyCreated: false
      }
      1 =&gt; Rating {#786 ▶}
      2 =&gt; Rating {#785 ▶}
    ]
  }
  </code></pre>
  
  <p>In one of my views, I need to show only the Ratings with <code>'max'</code> type and I am trying to filter the collection without success until now.
  My tries so far:</p>
  
  <p><code>if ($ratings &amp;&amp; $ratings -&gt; search('max') != false)</code></p>
  
  <p>OR</p>
  
  <p><code>if ($ratings &amp;&amp; $ratings -&gt; contains('max'))</code></p>
  
  <p>So... What is the smart and <em>eloquent</em> way of achieving this?</p>
  
  <p>Thanks in advance.</p>