A simple package for laravel to upload and resize media without any hassle.
Before to start you'll need to clone/download this package locally and then run from the terminal
$ composer install
$ php artisan vendor:publish
env('MEDIA_STORAGE_DRIVER', 's3')
handles the disk s3
or public
$processor = new Processor('pv_photo.png');` // accepts path to image
or
$processor = new Processor($request->file('image'));` // accepts path to image
$processor->resize(['small' => [100,200],'large' => [2000,1000]); // and you can define size and ratio so on
$processor->uploadResizedImages();
or
$processor->getResizedImages()->each(function ($resizedImage){
$resizedImage->setName('generatecustomname.jpg');
$resizedImage->upload();
$resizedImage->getUploadedfileUrl();
});
- Reads image from request / disk
- Upload original image with unique name with given sets of data
- Resize image into multiple sizes
- Upload resized images with custom name with custom path
- Currently tested with amazons3 and local storage