Download the PHP package r0bdiabl0/php-thumbor without Composer
On this page you can find all versions of the php package r0bdiabl0/php-thumbor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download r0bdiabl0/php-thumbor
More information about r0bdiabl0/php-thumbor
Files in r0bdiabl0/php-thumbor
Package php-thumbor
Short Description PHP library for generating Thumbor image URLs. Works standalone or with Laravel integration.
License MIT
Homepage https://github.com/r0bdiabl0/php-thumbor
Informations about the package php-thumbor
Thumbor PHP
A modern PHP library for generating Thumbor image URLs. Works standalone or with Laravel integration.
Features
- Zero dependencies - Pure PHP implementation, no external packages required
- Laravel optional - Works standalone or with full Laravel integration
- Modern PHP - Built for PHP 8.2+ with strict types and readonly properties
- Fluent API - Chainable methods for building complex image transformations
- Secure URLs - HMAC-SHA1 signed URLs for production security
- Full Thumbor support - Resize, crop, filters, smart cropping, and more
Requirements
- PHP 8.2 or higher
- Thumbor 6.0+ (7.0+ recommended for AVIF/WebP/HEIC support)
- Laravel 10, 11, 12, or 13 (optional, for Laravel integration)
Installation
Quick Start
Standalone Usage (No Framework)
Laravel Usage
The package auto-registers with Laravel 10+. Just publish the config:
Configure your .env:
Use the facade:
Or inject the service:
API Reference
Resizing
Cropping
Filters
Convenience Methods
The library provides convenience methods for common filters:
Thumbor Version Compatibility
Most features work with Thumbor 6.0+. The following require Thumbor 7.0+:
| Feature | Method | Thumbor Version |
|---|---|---|
| AVIF format | avif(), format('avif') |
7.0+ |
| HEIC format | format('heic') |
7.0+ |
| Max bytes | maxBytes() |
7.0+ |
| Saturation | saturation() |
7.0+ |
| Equalize | equalize() |
7.0+ |
Note: Using v7+ features on older Thumbor servers will result in the filter being ignored or an error from Thumbor.
Other Operations
Chaining
All methods are chainable:
Configuration
Laravel Config (config/thumbor.php)
Environment Variables
Unsafe URLs
For development or when security isn't required, you can generate unsigned URLs by omitting the secret key:
Warning: Never use unsafe URLs in production as they allow anyone to generate arbitrary image transformations.
Migration from r0bdiablo/laravel5-phumbor
This package replaces the deprecated r0bdiablo/laravel5-phumbor package. To migrate:
-
Update your
composer.json: -
Update namespace imports:
-
Update config file name:
- Old:
config/laravel5-phumbor.php - New:
config/thumbor.php
- Old:
-
Update config keys:
- Old:
laravel5-phumbor.server,laravel5-phumbor.key - New:
thumbor.server,thumbor.key
- Old:
- Update env variables:
- Old: (custom)
- New:
THUMBOR_SERVER,THUMBOR_KEY
The API methods remain the same.
Testing
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This package is open-sourced software licensed under the MIT license.
Credits
- Robert Pettique
- Inspired by 99designs/phumbor
- Built for Thumbor