I would like to access to a value from an array response, but I get null or an exception "Trying to get property of non object".
Here is my array:
array:5 [▼
677 => array:4 [▶]
676 => array:4 [▶]
675 => array:4 [▶]
674 => array:4 [▶]
673 => array:4 [▶]
]
I would like to get each id foreach items
array:5 [▼
677 => array:4 [▼
"qty" => 1
"montant" => "25.00"
"item" => Licencies {#961 ▼
#table: "licencies"
...
#attributes: array:46 [▶]
#original: array:46 [▼
"id" => 677
Here my actual controller
foreach ($items as $item) {
$item = $item;
dd($item);
}
When I do $item = $item->id to get the id of the object, I get "trying to get property of non object"
What should I do?