hotgeart's avatar

How to use intervention image cache with S3 ?

Hi,

I would like to use Digital Ocean Space (S3 compatible) to store my images. But I've no idea how to make them work with my current intervention setup for the image cache.

I use this at the moment:

<img src="{{ asset('cache/big-avatar/up/photo/'.$user->avatar) }}" >

How can I pass an url from Digital Ocean Space or S3?

Thx

0 likes
6 replies
fylzero's avatar

@hotgeart Simply upload to S3, keep a copy of the relative path and reference the S3 URL with the relative path behind it.

// Save to AWS S3 and return URL
Storage::disk('s3')->put($imageName, $image, 'public');
$s3_url = Storage::disk('s3')->url($imageName);
<img src="{{ $s3_url }}" >
24 likes
hotgeart's avatar

@fylzero That's not my question I know how to display an image from S3. What I want is Intervention image Cache to be able to create a thumbnail from an image from S3 via my Filter.

fylzero's avatar

@hotgeart Your question...

How can I pass an url from Digital Ocean Space or S3?

24 likes
hotgeart's avatar

@fylzero ... yes ignore the text with the context and thread title, just take the last paragraph. Your life must be confusing if you only read the last paragraph on every document.

Please or to participate in this conversation.