When I add this code to my blade. It displays and shows an array.
[‘2600000’] [‘4500000’]@foreach($amazings as $product)
{{ number_format($product->prices->pluck('value')) }}
@endforeach
When I add this code to my blade. It displays and shows an array.
[‘2600000’] [‘4500000’]@foreach($amazings as $product)
{{ number_format($product->prices->pluck('value')) }}
@endforeach
2
Answers
make the value $num float then pass that to that function.
Use floatval($num)
See documentation https://www.php.net/manual/en/function.floatval.php
Pluck will still return a collection. You’d need to iterate through it, either with another foreach loop, or such as through map, etc: