title: compare two collection arrays in laravel
body: <p>I'm working with <code>laravel</code>, and I have two collection arrays that look something like this:</p>
  
  <pre><code>$collection1 = [
      ['id' =&gt; 1, 'name'=&gt; 'phone', 'quantity' =&gt; 1, 'price' =&gt; 1200],
      ['id' =&gt; 2, 'name'=&gt; 'tv', 'quantity' =&gt; 3, 'price' =&gt; 800],
  ];
  
  $collection2 = [
      ['id' =&gt; 1, 'name'=&gt; 'phone', 'quantity' =&gt; 1, 'price' =&gt; 1200],
      ['id' =&gt; 2, 'name'=&gt; 'tv', 'quantity' =&gt; 3, 'price' =&gt; 400],
  ];
  </code></pre>
  
  <p>so I need to know if they are the same or not, comparing both collections. and if in some of the arrays one of the keys (or several) has a different value, then they will no longer be the same collections, for example in 1 collection the price of the second item has a value of 800 and the other collection of 400. there is Any native method of laravel collections to do this ?, or how can i do it with simple php arrays?</p>