PHPackages                             melonsmasher/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. [Image &amp; Media](/categories/media)
4. /
5. melonsmasher/laravel-glide

Abandoned → [axn/laravel-glide](/?search=axn%2Flaravel-glide)Library[Image &amp; Media](/categories/media)

melonsmasher/laravel-glide
==========================

league/glide wrapper for Laravel 5.1+

1.5.1(7y ago)09MITPHP

Since Oct 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/MelonSmasher/laravel-glide)[ Packagist](https://packagist.org/packages/melonsmasher/laravel-glide)[ Docs](https://github.com/AXN-Informatique/laravel-glide)[ RSS](/packages/melonsmasher-laravel-glide/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (11)Used By (0)

Laravel Glide
=============

[](#laravel-glide)

This package provides a Service Provider that allows you to very easily integrate Glide into a Laravel project. Moreover, multiple servers can be configured.

Glide is a easy on-demand image manipulation library written in PHP. It's part of the League of Extraordinary Packages.

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.

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

[](#installation)

Install through composer:

```
composer require axn/laravel-glide
```

In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the service provider to the array of providers in `config/app.php`:

```
// config/app.php

'provider' => [
    //...
    Axn\LaravelGlide\ServiceProvider::class,
    //...
];
```

In Laravel 5.5 the facade will automatically get registered. In older versions of the framework just add the facade to the array of aliases in `config/app.php`:

```
// config/app.php

'aliases' => [
    //...
    'Glide' => Axn\LaravelGlide\Facade::class,
    //...
];
```

Publish the config file of the package using artisan:

```
php artisan vendor:publish --provider="Axn\LaravelGlide\ServiceProvider"
```

Modify the environment file by adding the following lines:

```
GLIDE_IMAGE_DRIVER=gd
GLIDE_SIGN_KEY=SetComplicatedSignKey

```

Obviously you have to adjust the values according to your environment.

The driver can be "gd" or "imagick".

A 128 character (or larger) signing key is recommended. To help you do this, you can run the following command:

```
php artisan glide:key-generate
```

Usage
-----

[](#usage)

Create a route for each server you have configured:

```
// App/Http/routes.php

Route::get(config('glide.servers.images.base_url').'/{path}', [
    'uses' => 'GlideController@images'
])->where('path', '(.*)');

Route::get(config('glide.servers.avatars.base_url').'/{path}', [
    'uses' => 'GlideController@avatars'
])->where('path', '(.*)');
```

Create corresponding controllers/actions:

```
