I am getting the next error while printing a model content on my blade.php view:
htmlspecialchars() expects parameter 1 to be string, array given
This model "content" is a column (json type) in a table and it looks just like this:
[{"Item":2}]
And this is how i'm trying to use it on my view:
@foreach ($post->loot->content as $name => $amount)
<div class="item">
<i class="fab fa-cuttlefish"></i>
<div class="text">{{ $name }} <b>x{{ $amount }}</b></div>
</div>
@endforeach
For some reason, if i print $name alone, it shows the number (2) that should be printed while using the $amount variable.
Is there any way to solve my problem?