2017 © Pedro Peláez
 

library laravel-glide

league/glide wrapper for Laravel 5.1+

image

melonsmasher/laravel-glide

league/glide wrapper for Laravel 5.1+

  • Sunday, June 24, 2018
  • by MelonSmasher
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 11 Versions
  • 0 % Grown

The README.md

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., (*1)

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

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., (*3)

Installation

Install through composer:, (*4)

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:, (*5)

// 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:, (*6)

// config/app.php

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

Publish the config file of the package using artisan:, (*7)

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

Modify the environment file by adding the following lines:, (*8)

GLIDE_IMAGE_DRIVER=gd
GLIDE_SIGN_KEY=SetComplicatedSignKey

Obviously you have to adjust the values according to your environment., (*9)

The driver can be "gd" or "imagick"., (*10)

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

php artisan glide:key-generate

Usage

Create a route for each server you have configured:, (*12)

// 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:, (*13)

<?php

namespace App\Http\Controllers;

use Glide;
use Illuminate\Http\Request;

class GlideController extends Controller
{
    public function images($path, Request $request)
    {
        return Glide::server('images')->imageResponse($path, $request->all());
    }

    public function avatars($path, Request $request)
    {
        return Glide::server('avatars')->imageResponse($path, $request->all());
    }
}

Add image to your views:, (*14)


<img src="{{ Glide::url('example1.jpg', ['w' => 500, 'h' => 300, 'fit' => 'crop']) }}">


<img src="{{ Glide::server('avatars')->url('example2.jpg', ['w' => 250, 'fit' => 'fill']) }}">

The Versions

24/06 2018

dev-master

9999999-dev https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

24/06 2018

1.5.1

1.5.1.0 https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

24/06 2018

dev-laravel_5.6_support

dev-laravel_5.6_support https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

24/06 2018

1.5.0

1.5.0.0 https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

28/09 2017

1.4.0

1.4.0.0 https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

15/05 2017

1.3.0

1.3.0.0 https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

14/11 2016

1.2.0

1.2.0.0 https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

31/10 2016

dev-develop

dev-develop https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

31/10 2016

1.1.1

1.1.1.0 https://github.com/AXN-Informatique/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

28/10 2016

1.1.0

1.1.0.0 https://bitbucket.org/axn/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique

27/10 2016

1.0.0

1.0.0.0 https://bitbucket.org/axn/laravel-glide

league/glide wrapper for Laravel 5.1+

  Sources   Download

MIT

The Requires

 

by AXN Informatique