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 with an HTTP API. Resize, crop, and apply effects, then cache results with far-future headers. Works with GD, Imagick, or libvips, integrates with Flysystem, and can sign URLs for security.

View on GitHub
Deep Wiki
Context7

layout: default title: Responses

Responses

In addition to generating manipulated images, Glide also helps with creating HTTP responses using the getImageResponse() method. This is recommended over the outputImage() method, since it allows your application to handle the actual output of the image.

However, the type of response object needed depends on your application or framework. For example, you may want a PSR-7 response object if you're using the Slim framework. Or, if you're using Laravel or Symfony, you may want to use an HttpFoundation object. To use the getImageResponse() method you must configure Glide to return the response you want.

Response integrations

Vendor Message interface Adapter package
PSR-7 PSR-7 Included in base package
CakePHP Vendor specific league/glide-cake
Laravel HttpFoundation league/glide-laravel
Slim PSR-7 league/glide-slim
Symfony HttpFoundation league/glide-symfony
Zend PSR-7 league/glide-zend

Custom responses

If your particular project doesn't use PSR-7 or HttpFoundation, or if you'd like finer control over how your response objects are created, you can use your own response factories. Glide provides the ResponseFactoryInterface interface for this.

<?php

namespace League\Glide\Responses;

use League\Flysystem\FilesystemOperator;

interface ResponseFactoryInterface
{
    /**
     * Create the response.
     * [@param](https://github.com/param)  FilesystemOperator $cache The cache file system.
     * [@param](https://github.com/param)  string              $path  The cached file path.
     * [@return](https://github.com/return) mixed               The response object.
     */
    public function create(FilesystemOperator $cache, $path);
}
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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata