- Is approached/laravel-image-optimizer still maintained?
- No. The package is explicitly marked deprecated, so you should not expect upstream bug fixes, security patches, or compatibility updates for newer Laravel and PHP releases. If you retain it, pin versions, assign an owner, and plan to fork or replace it.
- How do I install and configure laravel-image-optimizer in a Laravel app?
- Install it with Composer, register the service provider if your Laravel version does not auto-discover it, and publish the configuration file. Define optimization profiles in config and wire the optimizer into your upload handler or media pipeline. Validate the Composer constraints against your Laravel and PHP versions before committing.
- Which optimizers and image formats does laravel-image-optimizer support?
- The package is described as using configurable optimizers such as JPEGoptim, OptiPNG, and SVGO, with profiles for different image types. You must confirm the exact formats and binary versions in a spike, and install those binaries wherever optimization runs. Test JPEG, PNG, WebP, animated, and large files with representative samples.
- Does laravel-image-optimizer work with Laravel storage disks such as S3?
- It integrates with Laravel storage and local filesystem disks, but remote disks like S3 require validation because native optimizers usually need local files or temporary copies. Confirm download, temp-file, write-back, permissions, and cleanup behavior for your target driver. Do not assume S3 support without an integration test.
- Can I run image optimization in a queue with Laravel?
- You can invoke optimization from a queued job, which is often preferable for uploads, but you must manage worker timeouts, memory limits, retries, and queue depth. The package's deprecated status means you own failure handling and observability. Keep the original image as a fallback and log binary and storage errors.
- What Laravel and PHP versions does this package support?
- The supported Laravel and PHP range is defined by the package's Composer constraints, and as a deprecated package it may lag current versions. Check the README and composer.json, then run a short compatibility spike on your exact matrix. Pin the version and use dependency and security scanning in CI.
- How do I handle image optimization failures in production?
- Define an explicit fallback that keeps or serves the original image when optimization fails, and catch exceptions around the optimizer and storage operations. Add metrics for success and failure counts, latency, size reduction, queue depth, and binary errors. Do not rely on silent failures being visible without your own logging and alerts.
- What are the best alternatives to this deprecated Laravel image optimizer?
- Maintained options include spatie/image-optimizer, Intervention Image, and managed image CDN or optimization services. Wrap any choice behind an internal ImageOptimizer contract so controllers and jobs do not depend directly on this package. That makes migration or replacement much cheaper.
- How should I test laravel-image-optimizer before using it in production?
- Test with representative JPEG, PNG, WebP, animated, and oversized images, and install the required binaries in CI. Cover local and remote disks, queue drivers, permission errors, missing binaries, and optimization failures. Also verify output quality, latency, memory use, and dependency security because the package is deprecated.
- Is laravel-image-optimizer suitable for a new Laravel project?
- No, it is not a good strategic choice for greenfield Laravel architecture because it is deprecated, has limited community momentum, and carries high lifecycle risk. Choose a maintained package or managed service, or fork only with explicit ownership and a replacement plan. If you must use it, contain it to the media pipeline behind an adapter.