- Is league/glide-symfony compatible with Laravel?
- No. league/glide-symfony is a Symfony bundle: it registers a GlideBundle, wires Glide into Symfony's DI container, and mounts a /glide route through Symfony's HttpKernel and routing. It will not bootstrap in a Laravel application without dragging in Symfony components you do not need. In Laravel, depend on league/glide directly and expose it with a small service provider and controller.
- How do I install and register league/glide-symfony in a Symfony app?
- Run composer require league/glide-symfony, then register the bundle in config/bundles.php. Import the bundle's routing resource under a /glide prefix so the image endpoint is reachable, and publish or create the bundle configuration file to declare your source and cache filesystems. Once those three steps are done you can request processed images by appending Glide parameters to the URL.
- Which Symfony and PHP versions does league/glide-symfony support?
- Version 2.1.0 targets Symfony 8 with PHP 8.3 to 8.4, while the 2.0.x line covers Symfony 6 and 7. Older releases serve Symfony 5.4, so the package spans Symfony 5.4 through 8.0 across its supported branches. Pin to the branch that matches your LTS and check the release notes before upgrading a major Symfony version.
- How do I configure the source image filesystem and cache in league/glide-symfony?
- Configuration is done through standard Symfony bundle config (YAML, XML, or PHP), where you declare the Flysystem source filesystem that holds your originals and the cache filesystem where generated images are written. Credentials and bucket names should come from environment variables rather than being hardcoded. Because both sides are Flysystem-backed, you can keep originals remote and the cache local, or vice versa.
- Can I use league/glide-symfony with S3, DigitalOcean Spaces, or other Flysystem adapters?
- Yes. The bundle composes cleanly with any Flysystem adapter, including local storage, Amazon S3, and S3-compatible services such as DigitalOcean Spaces. You configure the adapter as a Symfony filesystem service and reference it as the source or cache filesystem in the bundle config. Credentials are supplied through environment variables, keeping secrets out of committed config.
- How do I secure the /glide endpoint and stop people abusing image resizing?
- The /glide endpoint is a genuine abuse vector because unbounded resize requests can exhaust CPU and disk. Put it behind Symfony's HTTP cache or a CDN, add rate limiting at the proxy or firewall level, and use Glide's signed URL support so only URLs your application generated are served. Also restrict which parameters and dimensions clients can request rather than trusting arbitrary query strings.
- What should I use instead of league/glide-symfony in a Laravel application?
- Use league/glide directly, since the underlying Glide library is framework-neutral and does all the image manipulation work. You only need to write the thin glue: a service provider binding a Glide server factory, and a controller or route that streams the response. That avoids installing Symfony's HttpKernel and bundle machinery inside a Laravel app purely for routing.
- How does caching work with league/glide-symfony, and how do I invalidate cached images?
- Glide writes generated images to the configured cache filesystem, keyed by the source path plus the manipulation parameters, so repeat requests are served without re-processing. In production, front the /glide route with Symfony's HTTP cache or a CDN and set long cache lifetimes on the responses. Invalidation is your responsibility: when a source image changes, purge the matching CDN entries or the cache paths, since stale variants will otherwise persist. For large catalogs, consider pre-warming popular variants with a Symfony Messenger worker instead of relying purely on cold requests.
- Is league/glide-symfony actively maintained, and is the low dependent count a risk?
- The package has a modest install base (roughly a hundred stars and no declared dependents on Packagist), so treat governance as the main risk rather than runtime stability. The adapter itself is small wiring code over the mature league/glide library, so a stalled release has a limited blast radius: the worst case is a version bump or a few lines of glue you maintain yourself. Pin the version in composer.json, add it to your dependency-review process, and track releases ahead of Symfony upgrades.
- How do I test Glide image URLs in a Symfony functional test?
- Make a request to the /glide path with the source image path and Glide parameters in the query string using Symfony's KernelBrowser, then assert the status code and the image content type on the response. Point the bundle config at a test source filesystem containing a small fixture image and a temporary cache directory so tests do not touch production storage. If you use signed URLs, generate signatures in the test with the same sign key configured for the test environment.