I am using MongoDB and Laravel
I am doing the query as follows:
$json_datos = DB::table('items_tabla')->get();
$datos_finales= json_decode($json_datos );
The query $json_datos
I get this data:
so that's why I use the json_decode
to be able to get them as follows
blade
but the problem I have is that when I try to show _id
it I get an error because the id is inside another key, and I don't know how to enter it to get it
This is how I use the foreach in the blade:
@foreach ($datos_finales as $item)
{{$item->_id}} //error
{{$item->imagen}} //success
@endforeach
I would appreciate the help, thank you very much!
Try this way, you should be able to access your array without the stdClass