Decode and display base64 image.

How do I decode a base64 image from my database and display it in a table within a resource?
3 Replies
Saade
Saade2y ago
ImageColumn::make()
->extraImgAttributes(
fn (string $state) => ['srcset' => $state]
)
ImageColumn::make()
->extraImgAttributes(
fn (string $state) => ['srcset' => $state]
)
cheesegrits
cheesegrits2y ago
@Saade Wouldn't you need to prepend "data:image/png;base64, " to the raw base64 data in the srcset? Or are we assuming that's already in the data?
Saade
Saade2y ago
Assuming its already on the data

Did you find this page helpful?