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 /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 config
'remote_img_lg' => [
    'driver' => 'local',
    'root' => storage_path('app/public'),
    'url' => 'https://domain.com/w/500',
    'visibility' => 'public',
    'throw' => false,
]

but 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)
Was this page helpful?