ImageColumn make Table rendering so slow

This is my situation: I have db table (ads) without column for image, for retrieve ad's images i have an attribute that return me all links for ad's folder on s3. In my table i want to show image ad thumbnail. My attribute (i cannot change this code):
public function getPhotoThumbnailLinkAttribute()
{
return array_map(function ($item) {
return Storage::url($item);
}, Storage::files('ads/'.$this->id.'/thumbnail/'));
}
public function getPhotoThumbnailLinkAttribute()
{
return array_map(function ($item) {
return Storage::url($item);
}, Storage::files('ads/'.$this->id.'/thumbnail/'));
}
and i set ImageColum like that:
Tables\Columns\ImageColumn::make('photos')->extraImgAttributes(fn(Ad $record): array => [
'src' => head($record->photo_thumbnail_link),
'loading' => 'lazy'
]),
Tables\Columns\ImageColumn::make('photos')->extraImgAttributes(fn(Ad $record): array => [
'src' => head($record->photo_thumbnail_link),
'loading' => 'lazy'
]),
But Table is rendered only when all thumbnails are loaded and "ready" to be displayed. Is there any way to speed up the table loading? Thanks in advance
0 Replies
No replies yetBe the first to reply to this messageJoin