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 Symfony

Glide Symfony Laravel Package

league/glide-symfony

Symfony adapter for League Glide that plugs Glide image manipulation and on-the-fly resizing into Symfony apps. Install via Composer and follow the core Glide docs for setup, caching, and URL-based transformations.

View on GitHub
Deep Wiki
Context7

Glide adapter for Symfony

Frequently asked questions about Glide Symfony
Can I use League/Glide-Symfony in Laravel? If not, what’s the best alternative?
No, this package is **Symfony-specific** and won’t work in Laravel. For Laravel, use **spatie/laravel-image-optimizer** or **intervention/image** for local processing, or **spatie/laravel-medialibrary** for cloud storage integration. Glide-Symfony’s middleware and DI system are Symfony-exclusive.
How do I configure Glide-Symfony to work with AWS S3 for storage?
Edit your Symfony config (e.g., `config/packages/glide.yaml`) to specify the S3 adapter. Use the `league/glide-storage-s3` package for the backend and set credentials via environment variables. Example: `storage: s3://your-bucket?key=YOUR_KEY&secret=YOUR_SECRET&region=us-east-1`. Validate credentials in CI to avoid runtime errors.
What Symfony versions does Glide-Symfony support, and how do I ensure compatibility?
The package supports **Symfony 5.4–8.x** (check the [README](https://github.com/thephpleague/glide-symfony)). Pin to an LTS version in `composer.json` (e.g., `^6.0`) and test upgrades via `symfony/flex-recipes`. Avoid bleeding-edge Symfony releases until the package updates, as middleware changes may break integration.
How can I secure the /glide endpoint to prevent abuse or unauthorized access?
Add authentication via Symfony’s security system (e.g., API tokens or IP whitelisting). Use `firewall` rules in `security.yaml` to restrict access to trusted routes. For public endpoints, implement rate limiting (e.g., 100 requests/minute) via `symfony/rate-limiter` to prevent DoS attacks from large image requests.
Does Glide-Symfony support WebP or AVIF format conversion for modern browsers?
Yes, Glide-Symfony supports **WebP and AVIF** out of the box. Configure formats in your `glide.yaml` under `formats` (e.g., `webp`, `avif`). Use browser-sniffing middleware (like `symfony/webpack-encore`) to serve optimized formats dynamically, reducing bandwidth by up to 50% for compatible clients.
How do I handle caching to avoid regenerating images on every request?
Glide-Symfony uses **ETag caching** by default. For distributed caching, integrate with Symfony’s cache system (e.g., Redis) via `cache: pool` in config. Alternatively, use a CDN (Cloudflare, Fastly) to cache transformed images at the edge, reducing backend load. Purge cache on uploads via Symfony’s `CacheClearEvent`.
What happens if Glide fails to process an image? Can I fall back to a static placeholder?
Yes, configure a fallback in `glide.yaml` under `fallback`. For example, set `fallback: /path/to/placeholder.jpg` to serve a static image if processing fails. Log errors via Monolog to monitor failures, and consider async retries for transient issues (e.g., S3 timeouts) using Symfony Messenger.
How do I monitor Glide-Symfony performance (e.g., response times, failures) in production?
Use Symfony Profiler to track `/glide` endpoint metrics (response time, memory usage). For advanced monitoring, integrate with **Prometheus** (via `symfony/monolog-bundle`) or **New Relic** to alert on P99 latency spikes. Log Glide events to a dedicated channel (e.g., `glide.errors`) for debugging.
Can I use Glide-Symfony with VichUploaderBundle for file uploads?
Absolutely. VichUploaderBundle’s `Uploadable` entities can store Glide-generated URLs in the database. Configure `vich_uploader` to trigger Glide transformations post-upload via `onUpload` events. Example: `glide_url: '/glide/{{ file.path }}?width=800'`. This pipeline is common for e-commerce or CMS image handling.
What are the tradeoffs between local storage and S3 for Glide-Symfony?
Local storage is **faster** (no network latency) but scales poorly under high traffic. S3 offers **better scalability** and cost efficiency but adds ~100–200ms latency per request. For production, use S3 with CloudFront caching to balance performance and cost. Test with your expected traffic volume—local storage may suffice for <10K requests/day.
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