Answer the question
In order to leave comments, you need to log in
How to save multiple images in different sizes in Laravel?
Tell me how best to save pictures in different sizes, for example, 200x200, 800x800, 100,100
To save, I use this code, how to optimize it?
$filename = 'img' . '.'200x200'.'.jpg';
$resizedImage = Image::make($image);
$resizedImage ->resize(800,800,function($img){$img->aspectRatio();});
$resizedImage ->response('jpg');
Storage::put('uploads/' . $filename, $resizedImage);
Answer the question
In order to leave comments, you need to log in
Move it to a method and call it three times? What, exactly, is the problem?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question