Array structure
array:2 [
0 => array:3 [
"id" => 15710
"sale_id" => 6699
"item_id" => 300
]
1 => array:3 [
"id" => 15711
"sale_id" => 6699
"item_id" => 300
]
]
I'm trying to remove the second array if there have same item_id. Therefore, i referred to the array_unique but it seems does not work.
Code
$test = array_unique($model->items->toArray(), SORT_REGULAR);
Debugbar::addMessage($test,'test');