https://github.com/leartgjoni/laravel-thumbnail
Laravel Package to resize images on the fly with cache functionalities
https://github.com/leartgjoni/laravel-thumbnail
image intervention-image laravel package thumbnail thumbnails
Last synced: 5 months ago
JSON representation
Laravel Package to resize images on the fly with cache functionalities
- Host: GitHub
- URL: https://github.com/leartgjoni/laravel-thumbnail
- Owner: leartgjoni
- Created: 2018-03-09T18:27:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-09T20:42:54.000Z (over 8 years ago)
- Last Synced: 2025-09-19T02:58:12.626Z (9 months ago)
- Topics: image, intervention-image, laravel, package, thumbnail, thumbnails
- Language: PHP
- Size: 1.87 MB
- Stars: 13
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Laravel Thumbnail
Laravel Package to resize images on the fly with cache functionalities.
Using Thumbnail facade you will get resized images' paths on the fly. If an image resizing with same dimensions has been already requested before, the package will return the cached image from the previous request. Cached images are stored in "thumbs" folder inside your images root path.
## Installation
1. composer require lersoft/laravel-thumbnail dev-master
2. in config/app.php add in providers: Lersoft\LaravelThumbnail\LaravelThumbnailServiceProvider::class
3. in config/app.php add in aliases: 'Thumbnail' => Lersoft\LaravelThumbnail\Facades\LaravelThumbnail::class
4. php artisan vendor:publish --tag=config
## How to use
In your blade view insert:
thumb function takes 4 parameters:
1. path of image (change root path in config/thumb.php
2. $width (nullable)
3. $height (nullable)
4. $type (by default = fit). Types are:
a. "fit" - best fit possible for given width & height
b. "resize" - exact resize of image
c. "background" - fit image perfectly keeping ratio and adding black background
d. "resizeCanvas" - keep only center
# Don't forget to star this repo ;)