title: Laravel Compare Multiple Collections?
body: <p>How can I compare properties of multiple collections. I have the following code.</p>
  
  <pre><code>$games = Schedule::schedules()-&gt;where('gameTime', '&gt;', Carbon::now())-&gt;get();
  // returns a collection with 10+ arrays
  $picks = Pick::picks()-&gt;where('user_id', 1)-&gt;get();
  // returns a collection with 0 to 4 arrays
  
  if ($games-&gt;first()) {
      foreach ($games as $game) {
          // the following wont work but it's essentially what I want to do
          // compare $game-&gt;id to $pick-&gt;schedule_id
          if ($game-&gt;id == $pick-&gt;schedule_id) {
              $pick = Pick::picks()-&gt;where('user_id', 1)-&gt;where('schedule_id', '=', $game-&gt;id)-&gt;first();
              $pick-&gt;delete();
          }
      }
  }
  return 'picks deleted';
  </code></pre>
  
  <p>I want to compare <code>$game-&gt;id == $pick-&gt;schedule_id</code> inside the <code>foreach</code> loop.</p>