alex-kudrya / lara-thumb
A simple lite script that make thumbnails from original images
Installs: 28
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/alex-kudrya/lara-thumb
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... } };