alex-kudrya / lara-thumb
A simple lite script that make thumbnails from original images
1.4.1
2020-05-27 00:00 UTC
Requires
- php: >=7.3
- ext-gd: *
- illuminate/http: *
README
This script converts the original image into a thumbnail with the given sizes and various modes
Modes: «cover», «contain».
Available extensions: «jpg / jpeg», «png», «gif».
Example
use Illuminate\Http\Request; use Kudrya\LaraThumb\LaraThumb class MakeThumbnail() { public function run(Request $request, int $width = 100, int $height = 100) { $file = $request->file('image'); LaraThumb::processing($file, $width, $height, 'cover', false) // That's all, your image was reduced! // Then save the $file or do what you need with it... } };