hosmelq/laravel-imgproxy
Laravel integration for imgproxy that generates signed, on-the-fly image processing URLs. Configure sources, keys, and presets, then build resizing and cropping links directly from your models, Blade views, and storage disks with a clean, fluent API.
Architecture fit
This package is a thin, opinionated Laravel adapter over hosmelq/imgproxy, giving the framework three things: a fluent URL builder (Imgproxy::), filesystem macros on configured disks (imgproxyInfo(), plus extension/encoding arguments), and config-driven signing/encryption. That shape fits a standard Laravel architecture well: image transformation stays out of the app runtime (no GD/Imagick in-process), URLs are generated at render time or persisted for API responses, and configuration lives in config/ with env overrides. The v3.0.0 additions—infoBuilder()/imgproxyInfo() for image-info URLs, plus presets-only mode and option aliases—push it further toward a governed image-delivery layer rather than a convenience wrapper.
Integration feasibility
Low-to-moderate effort. There is no prior assessment, so this is a greenfield evaluation: a team can adopt v3.0.0 directly with no v2 migration burden. The main integration work is environmental, not code: a running imgproxy instance, key/salt (or encrypted-source keys and IVs), and a decision on disk-macro mapping. imgproxyInfo() requires imgproxy Pro—verify licensing before any design work assumes it.
Technical risk
hosmelq/imgproxy ^2.0, and identical builder calls may now emit different URLs. Any URL-equality test, snapshot test, or golden-fixture will break, and previously published URLs must be treated as untrusted until regenerated.format() semantics. Dropping implicit extension means any caller relying on format('webp') alone produces an extension-less path. This is a silent behavioral regression risk for teams porting v2 code snippets straight from documentation or blog posts.source_encoding, invalid custom IVs, and invalid encryption keys now throw. This is the right behavior, but it converts previously degraded output into 500s, so config validation must move earlier in the request lifecycle.Key questions
hosmelq/imgproxy ^2.0, and what is our pinned server version?infoBuilder() actually needed for the product?composer.json.Stack fit
Fits any Laravel app using the filesystem abstraction for media. The disk-macro surface is the low-friction path: existing Storage::disk('images')->url() call sites become ->imgproxyUrl(...)-style calls without restructuring controllers. Option aliases reduce vendor lock-in by letting the team standardize on internal argument names.
Migration path
Greenfield: adopt v3.0.0 directly; skip v2 entirely. Brownfield (v2 already in place, or hosmelq/imgproxy v1 pinned elsewhere): pin the underlying library first, then bump this package in the same commit—never separately, since the two version constraints are coupled.
Compatibility
format() call site and every encrypted-source generation path before upgrading.Sequencing
format() to build(extension: ...) (and encoding on macros) across the codebase.Maintenance
Small, single-maintainer-style packages carry bus-factor risk; the hard dependency on a second package (hosmelq/imgproxy) doubles the upgrade surface. Budget a recurring review each time either project tags a major. Config-file drift between environments is the most likely source of day-two incidents.
Support
Escalation path runs through two upstreams plus the imgproxy vendor (especially for Pro image-info). Internal runbook should cover: signature mismatch, unknown source_encoding, invalid IV/key, and imgproxy server version mismatch.
Scaling Positive: transformation load is entirely offloaded to imgproxy, which scales horizontally and independently. Our side is string-building, so app-side cost is negligible. Watch two things: presets-only mode limits request cardinality (a real CDN-hit-rate win), and image-info URLs add a second, typically uncached, round trip—cache them deliberately or they will become a latency and cost hotspot.
Failure modes
imgproxyInfo() fails while everything else keeps working; isolate that call path.format() removal → extension-less paths served with wrong content type.Ramp-up
Low for a Laravel developer already comfortable with the filesystem API—roughly a day to be productive with the builder and macros. Add half a day for signing/encryption concepts and an hour for the v3 specifics (build(extension:), throwing validation, presets-only). If the team is new to imgproxy itself, budget additional time on the server-side config and Pro feature boundaries.
How can I help you explore Laravel packages today?