| Package Data | |
|---|---|
| Maintainer Username: | jancyril |
| Maintainer Contact: | jancyril@segubience.com (Jan Cyril Segubience) |
| Package Create Date: | 2017-04-30 |
| Package Last Update: | 2017-08-06 |
| Home Page: | |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-22 15:15:38 |
| Package Statistics | |
|---|---|
| Total Downloads: | 16 |
| Monthly Downloads: | 0 |
| Daily Downloads: | 0 |
| Total Stars: | 1 |
| Total Watchers: | 1 |
| Total Forks: | 0 |
| Total Open Issues: | 0 |
A wrapper to easily use Glide in Laravel 5.
Download via composer:
composer require jancyril/glide-for-laravel
Add the GlideServiceProvider to your config/app.php inside the providers array:
'providers' => [
JanCyril\Glide\GlideServiceProvider::class,
];
Publish the config file for this package:
php artisan vendor:publish --provider="JanCyril\Glide\GlideServiceProvider"
Modify the values of your config/glide.php file to suit your needs.
Inject JanCyril\Glide\Glide in the class that will use it.
Resizing an image:
$this->glide->image($imagePath)
->resize(200,200)
->save($outputFile);
Adding a watermark to the image:
$this->glide->image($imagePath)
->addWatermark($watermarkImage)
->save($outputFile);
Manipulate image using available parameters from glide:
$parameters = [
'w' => 200,
'h' => 200,
'fit' => fill,
];
$this->glide->image($imagePath)
->manipulate($parameters)
->save($outputFile);
To see all available parameters visit Glide Page.
Dynamic image manipulation via route:
http://localhost/image/sample_image.jpg?w=200
You can pass parameters as query string to your URL.
The image segment in the URL can be changed in your config/glide.php.