how to merge array with same key, value pair
<p>how can I merge 2 array with same key, value pair in PHP below is the returned data.</p>

<pre><code>array:8
  0 =&gt; array:3
    "group" =&gt; array:2
      "id" =&gt; 1
      "name" =&gt; "data 1"
    ]
    "brief" =&gt; array:5
    "tasks" =&gt; array:1
  ]
  1 =&gt; array:3
    "group" =&gt; array:2
      "id" =&gt; 1
      "name" =&gt; "data 1"
    ]
    "brief" =&gt; array:5
    "tasks" =&gt; array:1
  ]
  2 =&gt; array:3
  3 =&gt; array:3
  4 =&gt; array:3
  5 =&gt; array:3
    "group" =&gt; array:2
      "id" =&gt; 6
      "name" =&gt; "data 5"
    ]
    "brief" =&gt; array:5
    "tasks" =&gt; array:1
  ]
  6 =&gt; array:3
    "group" =&gt; array:2
      "id" =&gt; 6
      "name" =&gt; "data 5"
    ]
    "brief" =&gt; array:5
    "tasks" =&gt; array:1
  ]
  "totalHours" =&gt; "31"
]
</code></pre>

<p>I need to merge array[0] and array[1] same with array[5] and array[6] since they have both the same group key and value. Im using Laravel btw.</p>