PHP JSON Decode de l'image URL
I have been working with php v8.1.5 and this happens:
I have these addresses saved in the "products" table in the image_path field (3 sizes):
{\"thumb\":\"\\/public\\/products\\/strawberry-pulp.png-thumb.png\",\"medium\":\"\\/public\\/products \\/strawberry-pulp.png-medium.png\",\"full\":\"\\/public\\/products\\/strawberry-pulp.png-full.png\"}
I want to retrieve "medium" size images with this code.
data-src="{{ url('images'.json_decode($p->image_path)->medium) }}"
But I get this error:
Attempt to read property "medium" on null
What is the right way?
Edmer Sánchez