Nick Kadutskyi
Nick Kadutskyi

Reputation: 188

How to use thumbnails in Laravel and store them on AWS S3 bucket

I need to implement convenient way to create thumbnails into Laravel Framework. But I want to store everything on Amazon S3. I checked this package https://github.com/Folkloreatelier/laravel-image but it doesn't have possibility to store cache of thumbnails on s3. I checked http://symfony.com/doc/current/bundles/LiipImagineBundle/index.html but it works good with Symfony and I don't know if it will work easy with Laravel. Do you have any experience in solving such problems?

Upvotes: 1

Views: 2422

Answers (1)

Alex Harris
Alex Harris

Reputation: 6402

I think the easiest solution is to use Intervention.

$image = Image::make($file)->resize($width, $height)->save();

and then you just do the standard s3->put and store the path into your database.

$s3->put($path, $image->__toString(), 'public');
$url = $this->s3->url($path);

I didn't thoroughly read through this but it might give you some more insight on how to use Intervention.

Upvotes: 2

Related Questions