I use controllers to load s3 images on my app as below;
$disk = Storage::disk('s3');
$s3Client = $disk->getAdapter()->getClient();
$stream = $s3Client->getObject([
'Bucket' => \Config::get('filesystems.disks.s3.bucket'),
'Key' => $filepath
]);
return response($stream['Body'], 200)->withHeaders([
'Content-Type' => $stream['ContentType'],
'Content-Length' => $stream['ContentLength'],
'Content-Disposition' => 'inline; filename="' . $project->logopath . '"',
]);
Then I access the image with below link;
http://127.0.0.1:8000/uploads/1/projectlogo
When I use the URL for img src link, my pages display the images properly. I am happy with the result. It works.
However, I dont have the same result when I try to load images from s3 on my pdf views. (I am able to load locally stored images).
How can I load images from my s3 storage in my pdf views?
Thanks.