- How do I install onliner/imgproxy-php in a Laravel application?
- Install it with Composer using composer require onliner/imgproxy-php. In Laravel, the package offers optional integration and a service provider, so check the package README for whether auto-discovery applies or whether you must register the provider and publish configuration manually. Bind the client through Laravel's container rather than instantiating it in controllers or Blade templates.
- Does imgproxy-php support signed URLs with key and salt?
- Yes. The package supports signed and unsigned URLs through configurable key and salt support, so it can generate imgproxy-compatible signatures for you. Keep the key and salt in environment variables and load them through config, not in source code. Test both signed and unsigned modes against your imgproxy instance before rolling out.
- Which Laravel versions and PHP versions are supported by imgproxy-php?
- The supplied package overview does not list exact PHP or Laravel version constraints. Check the composer.json on Packagist and the canonical repository before adoption, and confirm the constraints match your application's PHP and Laravel versions. Also verify the imgproxy version and signing algorithm your instance uses.
- How do I configure IMGPROXY_BASE_URL and secrets for imgproxy-php in Laravel?
- Store IMGPROXY_BASE_URL, key, salt, default presets, and allowed source patterns in environment variables, then expose them through a Laravel config file. Wrap the package in a singleton service bound in the container so URL generation is centralized. Never hard-code secrets in templates or commit them to the repository.
- Can I use imgproxy-php without Laravel?
- Yes. The package is described as framework agnostic, with Laravel integration as an optional layer. You can use its fluent URL builder in plain PHP or another framework and swap PSR-18 and PSR-7 compatible HTTP internals. Laravel users still benefit from a service provider and config-driven setup.
- How do I generate resize, crop, gravity, and format URLs with imgproxy-php?
- Use the fluent, chainable API to add resize, crop, gravity, quality, and format options before generating the URL. The package builds the transformation path and signing logic so you do not hand-assemble imgproxy URLs. Verify exact method names and option mapping in the README, then test generated URLs against staging imgproxy.
- Does imgproxy-php support presets and custom imgproxy processing options?
- The overview mentions extensible presets and options for custom imgproxy processing pipelines. Use presets to standardize common transformations such as thumbnail, hero, or responsive variants so CDN cache keys stay consistent. Confirm whether your required imgproxy or imgproxy Pro features are supported before depending on them.
- How should I test imgproxy-php URLs before using them in production?
- Start with a non-production spike and unit tests for URL construction and signing. Compare generated URLs, signatures, transformation output, and cache behavior against your existing helper or hardcoded URLs. Test signed and unsigned modes, remote source URL encoding, expiration behavior, and option combinations against a staging imgproxy.
- Is imgproxy-php safe for production and what are the maintenance risks?
- Functional risk is modest because URL building and HMAC signing are well-bounded, but the package has limited community validation and an unknown repository reference in the supplied material. Validate Packagist ownership, release tags, CI, test coverage, security policy, and maintainer activity. Pin the version and keep an internal wrapper so you can replace or fork it if needed.
- Are there alternatives to imgproxy-php or can I replace it with a custom URL builder?
- You can replace it with an internal URL builder or another imgproxy client if the package is abandoned or lacks a required signing or option capability. Because MIT licensing generally allows forking, treat a fork as a deliberate contingency rather than the default. Keep your Laravel wrapper as the stable contract so alternatives can be swapped with minimal template changes.