I'm working with laravel, and I have two collection arrays that look something like this:
$collection1 = [
['id' => 1, 'name'=> 'phone', 'quantity' => 1, 'price' => 1200],
['id' => 2, 'name'=> 'tv', 'quantity' => 3, 'price' => 800],
];
$collection2 = [
['id' => 1, 'name'=> 'phone', 'quantity' => 1, 'price' => 1200],
['id' => 2, 'name'=> 'tv', 'quantity' => 3, 'price' => 400],
];
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?