To display the product data as a string on the frontend, you can use the implode() function in PHP to join the array values with a separator. Here's an example:
@foreach ($sph as $x)
<tr>
<td>{{ implode(', ', json_decode($x->produk)) }}</td>
</tr>
@endforeach
In this example, we're using json_decode() to convert the JSON string to a PHP array, and then using implode() to join the array values with a comma and space separator.
Alternatively, if you want to display the product data without the "produk:" label, you can use the implode() function directly on the JSON string:
@foreach ($sph as $x)
<tr>
<td>{{ implode(', ', json_decode($x->produk)->produk) }}</td>
</tr>
@endforeach
In this example, we're using json_decode() to convert the JSON string to a PHP object, and then accessing the produk property to get the array values.