pagevamp/laravel-image-processor

Package for uploading / resizing images into disk. Tested with s3/local & laravel 5.8

Downloads

4

Stars

1

Version

0.0.1

Media upload / resize

A simple package for laravel to upload and resize media without any hassle.

Installation

Before to start you'll need to clone/download this package locally and then run from the terminal

$ composer install
$ php artisan vendor:publish

Usage

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();
       });

Features

  • 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

wercker status

pagevamp

Author

pagevamp