Download the PHP package square1/resized-laravel without Composer
On this page you can find all versions of the php package square1/resized-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download square1/resized-laravel
More information about square1/resized-laravel
Files in square1/resized-laravel
Package resized-laravel
Short Description Laravel package for resized.co, the on-demand image manipulation service.
License MIT
Homepage https://github.com/square1-io/resized-php-laravel
Informations about the package resized-laravel
Resized
This is the Laravel package for resized.co, an on-demand image resize manipulation service.
Requires PHP 8.2 and Laravel 10 or higher.
Install
Via Composer
The package supports auto-discovery. The service provider and facade are registered automatically.
To manually register the service provider in your config/app.php:
Find the providers key in your config/app.php and register the Resized Service Provider.
Find the aliases key in your config/app.php and add the Resized facade alias.
Configuration
By default, the package uses the following environment variables to auto-configure the plugin without modification:
You can also publish the config file to set default processing options applied to every process() call:
When RESIZED_KEY or RESIZED_SECRET are not set, the service falls back to a local pass-through mode that returns URLs unchanged, so your application does not crash in environments without credentials configured.
On a local environment (detected via the environment config key), the package always uses pass-through mode regardless of credentials, returning relative and absolute URLs unchanged.
Usage
Set the default failover image.
Generate a 300x500 resized image URL.
Generate an image URL constrained to 300 width whilst maintaining aspect ratio.
Generate an image URL constrained to 500 height whilst maintaining aspect ratio.
Override the image slug used in the generated URL.
Specify the compression level through the options array. Quality ranges from 0 (poor quality, small file) to 100 (best quality, large file). Only applies to JPG encoding. Default: 90.
Limit the maximum character length of the filename slug appended to the generated URL.
Relative URLs and non-HTTP URLs are returned unchanged without making a request to the resized.co service.
Testing
License
The MIT License (MIT). Please see License File for more information.