0
I need to get the values an array that is being returned from the Laravel, but I’m not getting to understand how to do this.
Laravel:
if ($request->ajax()) {
return response()->json([
$prod->unique()
]);
}
Array:
[
[
{
"id":3,
"nome":"Cerveja HEINEKEN Garrafa 330ml",
"preco":"4,80",
"tamanho":"330ml",
"desc":null,
"imagem":"0310412021060360b848319b870.jpg",
"qunt":"37",
"categoria":"1",
"created_at":"2021-06-03 03:10:41",
"updated_at":"2021-06-17 02:33:05"
}
]
]
I want to have access to each of the values through Javascript.
Ex:
<script>
....
success: function(data) {
alert(***Queria o preco aqui***);
},
</script>
Our guy! thanks never thought it would be that simple. Thank you very much msm.
– Loginn