1$collection = collect([
2 'color' => 'orange',
3 'type' => 'fruit',
4 'remain' => 6
5]);
6
7$diff = $collection->diffAssoc([
8 'color' => 'yellow',
9 'type' => 'fruit',
10 'remain' => 3,
11 'used' => 6
12]);
13
14$diff->all();
15
16// ['color' => 'orange', 'remain' => 6]