Download the PHP package axn/laravel-glide without Composer
On this page you can find all versions of the php package axn/laravel-glide. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download axn/laravel-glide
More information about axn/laravel-glide
Files in axn/laravel-glide
Package laravel-glide
Short Description league/glide wrapper for Laravel
License MIT
Homepage https://github.com/AXN-Informatique/laravel-glide
Informations about the package 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.
Upgrade
For upgrade instructions please see the UPGRADE.md
file.
Installation
Install through composer:
Environment
Edit your environment file by adding the following lines:
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:
Filesytem disks
For file storage it is possible to use as many servers as desired. In order to keep an organized storage architecture, we advise you to create several disks according to their uses.
You will then create a disk in the file /config/filesystems.php
to store our images, and another one for user avatars:
Configuration
Then publish the configuration files using artisan:
These files then published are rather to be taken as an example. Take the time to read the comments to understand what you can configure.
For example in these files we have configured two servers, one for images and a second for user avatars.
The name of the filestem "source", "cache" and "watermarks" must then be the same as that of the disk in the configuration of the filesystem of the application. The path prefixes will then depend on the configured disk.
It's not very obvious at first glance, but it gives you a lot of freedom to organize the storage of your files. And when you understand how it works and how you can benefit from it, you will be happy with the flexibility it gives you.
After looking at these files, feel free to delete, modify and create your own files as needed.
Usage
Create a route for each server you have configured:
Create corresponding controllers/actions:
Add image to your views:
All versions of laravel-glide with dependencies
laravel/framework Version ^9.0 || ^10.0 || ^11.0
league/glide-symfony Version ^2.0