andyandy's avatar

How to use imagejpeg() in Laravel?

I can use this to upload image directly:

$path = $request->file('image')->store('public/img/200x200');

I want to first resize image in PHP and than store it with:

imagejpeg($thumb, '../storage/app/public/img/200x200/asd.jpg', 80);

Which seems to work. But it obviously doesn't generate file name. Is it even a correct way? Could I somehow join Laravel store() method and imagejpeg()?

0 likes
1 reply

Please or to participate in this conversation.