ImageEntry src URL
I have a database column that contains a relative URL that, depending on context, needs to have a different domain and path prepended to it.
For example,
the DB column value is
How can I prepend these values to the ImageEntry component?
I have tried creating a special disk inside
but when I use it in the component the
For example,
the DB column value is
/bysZeUvSPZPJnku4qkHF34CdgMG.jpg and the same filename is used for a thumbnail using the https://domain.com/w/100 prefix and for the main image using the https://domain.com/w/500 prefix.How can I prepend these values to the ImageEntry component?
I have tried creating a special disk inside
filesystems.php using the following configbut when I use it in the component the
src attribute of the img tag is not set.Solution
Oh right. It's requiring
$state. ->getStateUsing(fn ($record) => 'https://domain.com/w/500'.$record->your_image_column)