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
Laravel Glide

Laravel Glide Laravel Package

ralphjsmit/laravel-glide

Generate responsive srcset/sizes image URLs on the fly with Glide in Laravel. Drop in the original image, use glide()->src() in Blade, and get resized variants served automatically (with lazy loading), no manual exports or config needed.

View on GitHub
Deep Wiki
Context7

Auto-magically generate responsive images from static image files.

Frequently asked questions about Laravel Glide
How does Laravel Glide improve image performance for responsive websites?
Laravel Glide dynamically generates `srcset` and `sizes` attributes for images using Glide, ensuring browsers load only the optimal image size for each device. This reduces bandwidth usage and improves page load times, directly addressing Core Web Vitals metrics like Largest Contentful Paint. The package also adds lazy loading by default, further enhancing performance.
Can I use Laravel Glide without publishing the config file?
Yes, the package works out-of-the-box with zero configuration. It uses sensible defaults for image scaling (e.g., widths of 400, 800, 1200, 1600, 2000, and 2500 pixels) and lazy loading. Only publish the config if you need to customize cache locations, scaling values, or disk support (e.g., for S3).
Will Laravel Glide work with Laravel 11, 12, or 13?
Laravel Glide officially supports Laravel 11, 12, and 13. The package is designed to align with Laravel’s latest features, including the updated `glide()` helper syntax. However, backward compatibility with older Laravel versions (e.g., 10 or below) is not guaranteed, so verify your project’s Laravel version before installation.
How does caching work, and do I need to clear it manually?
The package caches generated image variants in `storage/framework/cache/glide` to avoid reprocessing the same images. Cache invalidation is handled via the `glide:clear` Artisan command. For production, automate cache clearing using Laravel events, deployment hooks, or queues to avoid manual intervention when images are updated.
Can I customize the image sizes or add additional processing like WebP conversion?
Yes, you can customize scaling values, add WebP conversion, or apply filters (e.g., grayscale, blur) by publishing the config file and extending Glide’s configuration. The package leverages League/Glide’s full feature set, so advanced use cases like cropping, resizing, or format conversion are supported. Check the [Glide documentation](https://glide.thephpleague.com/) for details.
Does Laravel Glide support cloud storage like AWS S3?
Yes, Laravel Glide supports cloud storage, including S3, but you’ll need to publish the config file and specify the disk in the configuration. The package uses Laravel’s Filesystem, so any disk configured in `config/filesystems.php` can be used. Ensure the disk is writable for cache storage.
What happens if I update an image in production? Will users see the old cached version?
If you update an image, the old cached versions will remain until the cache is cleared. Run `php artisan glide:clear` to invalidate the cache. For production, automate this process using Laravel’s `queue:work` or deployment scripts to ensure users always see the latest images without manual intervention.
Is there a performance impact for high-traffic sites using dynamic image generation?
Dynamic image generation introduces runtime processing, which can increase server load for high-traffic sites. However, the package’s caching mechanism mitigates this by storing processed images. Monitor cache hit/miss ratios and consider pre-warming critical images during deployment. For extreme traffic, pre-generating static variants may be preferable.
Can I use Laravel Glide with SVG files?
No, Laravel Glide does not support SVG files for `srcset` generation. SVG is a vector format and doesn’t benefit from responsive scaling like raster images (e.g., PNG, JPEG). If your project relies heavily on SVGs, consider handling them separately or using a different approach for vector graphics.
Are there alternatives to Laravel Glide for responsive images in Laravel?
Yes, alternatives include Spatie’s `laravel-image-optimizer` (for pre-processing) or direct integration with League/Glide without a wrapper. However, Laravel Glide stands out for its seamless Laravel integration, Blade helper, and zero-configuration setup. If you need more control, consider using Glide directly or exploring packages like `intervention/image` for advanced manipulations.
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.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity