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: Base URL

Base URL

It's common to route all images under the path /img/. However, since Glide maps image request paths directly to the image source paths, you would have to have an /img/ folder in your source location as well. For example:

'http://example.com/img/kayaks.jpg' => '/path/to/source/img/kayaks.jpg'
'http://example.com/img/users/jonathan.jpg' => '/path/to/source/img/users/jonathan.jpg'

Since this isn't ideal, Glide allows you to define a base_url which is omitted from the source path.

Set the base URL

<?php

// Set using factory
$server = League\Glide\ServerFactory::create([
    'base_url' => '/img/',
]);

// Set using setter method
$server->setBaseUrl('/img/');

With the base URL configured, the new image source paths will no longer include /img/.

'http://example.com/img/kayaks.jpg' => '/path/to/source/kayaks.jpg'
'http://example.com/img/users/jonathan.jpg' => '/path/to/source/users/jonathan.jpg'
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.
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
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai