Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Glide Laravel Package

league/glide

Glide is an on-demand PHP image manipulation library served over HTTP. Resize, crop, and apply effects with simple URL parameters, with automatic caching and far-future headers. Works with GD, Imagick, or libvips and Flysystem storage.

View on GitHub
Deep Wiki
Context7

layout: default title: Basic usage

Basic usage

Once your Glide server is configured, there are a number of methods available to interact with it. For basic setups you'll likely only need the outputImage() method. However, if you plan to use Glide with a queuing server or in other more complex configurations, these methods will be useful.

Available methods

<?php

$server->getSourcePath();       // Get the source path
$server->getCachePath();        // Get the cache path
$server->sourceFileExists();    // Check if a source file exists
$server->cacheFileExists();     // Check if a cache file exists
$server->outputImage();         // Generate and output manipulated image
$server->getImageResponse();    // Generate and return response object of manipulated image
$server->makeImage();           // Generate manipulated image

Accepted method parameters

All of the above methods will accept an instance of the Symfony\Component\HttpFoundation\Request class. However, sometimes it's desirable to manually pass the image path and manipulation parameters. Glide makes this easy by also allowing you to pass a $path and $params combination to the above methods. Consider the following example:

<?php

Route::get('img/users/{id}/small', function($id) use ($server) {
    $server->outputImage(
        '/users/' . $id . '.jpg',
        [
            'w' => 300,
            'h' => 400,
            'fit' => 'crop',
        ]
    );
});
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium