PHPackages                             vis/laravel-glide - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vis/laravel-glide

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vis/laravel-glide
=================

A Glide Service Provider for Laravel

1.0.6(10y ago)453MITPHPPHP &gt;=5.4.0

Since Jan 19Pushed 10y agoCompare

[ Source](https://github.com/arturishe21/laravel-glide)[ Packagist](https://packagist.org/packages/vis/laravel-glide)[ RSS](/packages/vis-laravel-glide/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (12)Used By (0)

A Glide Server Provider for Laravel
===================================

[](#a-glide-server-provider-for-laravel)

[![Build status](https://camo.githubusercontent.com/c7748bd0cff94b9a109190da60c4fd59c442515086283b9507aba23b771b4a3b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f667265656b6d75727a652f6c61726176656c2d676c6964652e737667)](https://travis-ci.org/freekmurze/laravel-glide)[![Latest Version](https://camo.githubusercontent.com/7ebfe433624e09c87d8bd4e1268240828e4448c2d5fce2b64e48fcc35cf3b0f3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f667265656b6d75727a652f6c61726176656c2d676c6964652e7376673f7374796c653d666c61742d737175617265)](https://github.com/freekmurze/laravel-glide/releases)[![SensioLabsInsight](https://camo.githubusercontent.com/399f88108956fbcaeb8584959853563980da1f166d194955ee902fc11636045b/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f61643034323263612d653331662d343461332d623031612d6565356563373537623138642e737667)](https://insight.sensiolabs.com/projects/ad0422ca-e31f-44a3-b01a-ee5ec757b18d)[![Quality Score](https://camo.githubusercontent.com/a2553e2ade0380e83594d0704d0f11fa55aa59bad2f089ce5c41b6805b3a1608/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f667265656b6d75727a652f6c61726176656c2d676c6964652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/freekmurze/laravel-glide)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/852f09a352ac665a1ef76e9505bb40f398c23d7ff953fe4daa07a836977cc2b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d676c6964652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-glide)

This package provides a Service Provider that allows you to very easily integrate [Glide](http://glide.thephpleague.com/) into a Laravel project.

[Glide](http://glide.thephpleague.com/) is a easy on-demand image manipulation library written in PHP. It's part of the [League of Extraordinary Packages](http://thephpleague.com/).

Using this package you'll be able to generate image manipulations on the fly and generate URL's to those images. These URL's will be signed so only you will be able to specify which manipulations should be generated. Every manipulation will be cached.

It's also possible to generate an image manipulation separately and store it wherever you want.

Laravel compatibility
---------------------

[](#laravel-compatibility)

Laravellaravel-glide4.2.x1.x5.x2.xVersion 2.x with Laravel 5 compatibility will be released february 2015.

Installation
------------

[](#installation)

You can install the package through Composer.

```
composer require spatie/laravel-glide
```

You must install this service provider.

```
// Laravel 4: app/config/app.php

'providers' => [
    ...
    'Spatie\Glide\GlideServiceProvider',
    ...
];
```

This package also comes with a facade, which provides an easy way to generate images.

```
// Laravel 4: app/config/app.php

'aliases' => [
	...
    'GlideImage' => 'Spatie\Glide\GlideImageFacade',
    ...
]
```

You can publish the config file of the package using artisan.

```
php artisan config:publish spatie/laravel-glide
```

The config file looks like this:

```
return [
    /*
     * Glide will search for images in this directory
     *
     */
    'source' => [
        'path' => storage_path('images'),
    ],

    /*
     * The directory Glide will use to store it's cache
     * A .gitignore file will be automatically placed in this directory
     * so you don't accidentally end up committing these images
     *
     */
    'cache' => [
        'path' => storage_path('glide-cache'),
    ],

    /*
     * URLs to generated images will start with this string
     *
     */
    'baseURL' => 'img',

    /*
     * The maximum allowed total image size in pixels
     */
    'maxSize' => 2000 * 2000
];
```

The options in the config file are set with sane default values and they should be self-explanatory.

Usage
-----

[](#usage)

\###Generating an image on the fly

Assuming you've got an image named "kayaks.jpg" in `app/storage/images` (the input directory specified in the config file) you can use this code in a blade view:

```

```

The arguments for `modify` can also be used as a second (optional) argument for `load`:

```

```

The function will output a signed URL to a greyscale version of kayaks.jpg that has a width of 50 pixels. As soon as the URL gets hit by your browser, the image will be generated on the fly. The generated image will be saved in `app/storage/glide-cache` (= the cache directory specified in the input file).

Take a look at [the image API of Glide](http://glide.thephpleague.com/api/size/) to see which parameters you can pass to the `modify`-method.

\###Generating an image directly on the server It's also possible to generate an image manipulation separately and store it wherever you want.

Assuming you've got an image named "kayaks.jpg" in `app/storage/images` (the input directory specified in the config file):

```
GlideImage::load('kayaks.jpg')
	->modify(['w'=> 50, 'filt'=>'greyscale'])
	->save($pathToWhereToSaveTheImage);
```

Take a look at [the image API of Glide](http://glide.thephpleague.com/api/size/) to see which parameters you can pass to the `modify`-method.

Notes
-----

[](#notes)

### Cleaning the cache

[](#cleaning-the-cache)

For the moment Glide doesn't clean the cache directory, but that functionality [may be coming in a future release](https://github.com/thephpleague/glide/issues/7). Until then it's your job to keep an eye on it's total size. If it becomes too big, you can opt to delete the files inside it.

### Other filesystems

[](#other-filesystems)

Currently this package only supports images stored on the local filesystem. Glide itself leverages [Flysystem](https://github.com/thephpleague/flysystem) to read and write to various filesystems. I'd like support for that in this package let me know or feel free to submit a pull request.

Credits
-------

[](#credits)

- [Freek Van der Herten](https:/murze.be)
- [All Contributors](https://github.com/freekmurze/laravel-glide/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](https://github.com/freekmurze/laravel-glide/blob/master/LICENSE) for more information.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~0 days

Total

10

Last Release

3966d ago

Major Versions

0.3.0 → 1.0.02015-02-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b7ffd6192296a7a4be50ef6051026bdcb226401a5114d64dacc16dcaf7fb827?d=identicon)[arturishe](/maintainers/arturishe)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (72 commits)")[![MatthiasDeWinter](https://avatars.githubusercontent.com/u/8791525?v=4)](https://github.com/MatthiasDeWinter "MatthiasDeWinter (2 commits)")[![Big-Shark](https://avatars.githubusercontent.com/u/646054?v=4)](https://github.com/Big-Shark "Big-Shark (1 commits)")[![Cherry-Pie](https://avatars.githubusercontent.com/u/3027596?v=4)](https://github.com/Cherry-Pie "Cherry-Pie (1 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/vis-laravel-glide/health.svg)

```
[![Health](https://phpackages.com/badges/vis-laravel-glide/health.svg)](https://phpackages.com/packages/vis-laravel-glide)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
