- How do I install webfactory/phumbor in a Laravel app?
- Install it with Composer using composer require webfactory/phumbor. In Laravel, the package's service provider and facade are typically registered through package discovery, and you can publish the configuration file with php artisan vendor:publish. After that, set your Thumbor host, port, and security key in the published config or environment variables.
- How do I configure the Thumbor server host, port, and security key in Laravel?
- Publish the package config and set the Thumbor server host, port, and security key values, preferably through environment variables so each environment can point at a different Thumbor service. The facade reads that configuration when building URLs, so you do not need to pass server details on every call. Use php artisan config:cache in production if your deployment uses config caching.
- How do I generate a secure signed Thumbor URL with Phumbor?
- Use the secure URL builder and make sure your Thumbor security key is configured. Phumbor generates the HMAC signature from the image path and transformation options, producing a signed URL that Thumbor will accept only if the signature matches. Avoid unsigned or unsafe URLs when the image source or transformations must be trusted.
- What is the difference between safe, unsafe, and secure Thumbor URLs?
- In Thumbor, safe and unsafe URLs control whether Thumbor will process arbitrary image sources or enforce its configured source restrictions, while secure URLs add an HMAC signature based on your security key. Phumbor can generate all three forms. Use secure, signed URLs when you need to prevent clients from inventing their own transformations or image paths.
- Can I apply Thumbor filters like blur, quality, and watermarks using this package?
- Yes. Phumbor supports Thumbor filters such as blur, quality, and watermarks through its fluent API. You chain the filter methods before generating the final URL, and the package formats them into the Thumbor filter segment. Check the Phumbor API for exact filter method names and argument order.
- How do I resize, fit-in, or crop an image with the Phumbor facade?
- Use the fluent builder to chain resize, fit-in, and crop operations, then call the URL generation method for safe, unsafe, or secure output. The facade exposes the same builder so you can construct transformations inline in Laravel code. The resulting string is a Thumbor request URL; your application does not process the image itself.
- Which Laravel and PHP versions does this package support?
- The underlying webfactory/phumbor library is framework-agnostic and lightweight, while this package provides the Laravel service provider and facade. Supported Laravel and PHP versions are defined in the package's composer.json constraints, so check those before upgrading. Also review the repository's release activity if long-term maintenance is a concern.
- How do I test Phumbor URL generation in a Laravel application?
- You can unit test URL generation without running a Thumbor server by calling the facade and asserting the generated URL string, including the path, dimensions, filters, and signature. Configure a known security key in the test environment so secure URL assertions are deterministic. If your application downloads or stores the resulting images, mock those HTTP calls separately with Laravel's HTTP fake.
- How do I keep the Thumbor security key safe in production?
- Store the Thumbor security key in environment variables or a secrets manager, never in committed configuration files, and restrict who can read production environment settings. Generate secure, signed URLs for trusted transformations and keep the Thumbor server's source restrictions aligned with your application. Because image processing happens on Thumbor, also monitor that service and cache generated URLs where appropriate.
- What are alternatives to Phumbor for image manipulation in Laravel?
- Alternatives include Intervention Image for processing images inside PHP, Glide for on-demand image manipulation, and imgproxy or Thumbor itself as dedicated image services. Phumbor is a good fit when you already run Thumbor and want a small Laravel facade that builds correct, signed URLs. Compare based on whether you want to offload processing to a service or keep it in your Laravel application.