Download the PHP package rikodev/laravel-imgproxy without Composer

On this page you can find all versions of the php package rikodev/laravel-imgproxy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-imgproxy

rikodev/laravel-imgproxy

Signed imgproxy URL builder for Laravel with full IDE autocomplete via typed options, backed enums, and PHP 8.4 property hooks.


Installation

Publish the config file (optional — the package merges its own defaults automatically):


Configuration

Add the following keys to your .env:

Key Default Description
IMGP_KEY '' Imgproxy signing key (hex-encoded)
IMGP_SALT '' Imgproxy signing salt (hex-encoded)
IMGP_HOST https://imgproxy.example.com Imgproxy instance base URL
IMGP_DEBUG_URL_FROM http://example.test Local origin replaced in debug mode
IMGP_DEBUG_URL_TO https://example.pro Production origin used instead

Debug URL rewrite — imgproxy is a remote service and cannot reach localhost. In debug mode the package automatically rewrites the local origin to the production origin so imgproxy can fetch the source image.


Usage

Global helper (recommended)

Facade

Direct injection


Options reference

All parameters are named, so your IDE shows every option with its type as you type new Options(.

ResizeType enum

Case Value Description
ResizeType::Fit fit Keeps aspect ratio, fits the whole image within the box. Default.
ResizeType::Fill fill Keeps aspect ratio, fills the box and crops the excess.
ResizeType::Auto auto Uses Fill when source has an alpha channel, Fit otherwise.
ResizeType::ForceFit force_fit Same as Fit but never enlarges a smaller source.
ResizeType::ForceFill force_fill Same as Fill but never enlarges a smaller source.

Gravity enum

Case Value Description
Gravity::Smart sm Content-aware smart crop (imgproxy detects the focus point).
Gravity::Center ce Center of the image.
Gravity::North no Top edge.
Gravity::South so Bottom edge.
Gravity::East ea Right edge.
Gravity::West we Left edge.
Gravity::NorthEast noea Top-right corner.
Gravity::NorthWest nowe Top-left corner.
Gravity::SouthEast soea Bottom-right corner.
Gravity::SouthWest sowe Bottom-left corner.

Format enum

Case Value
Format::WebP webp
Format::Avif avif
Format::Jpeg jpg
Format::Png png
Format::Gif gif

Examples

Resize to fixed width, keep aspect ratio:

Thumbnail with smart crop:

Square avatar, converted to WebP:

High-quality hero image:

Width only with explicit quality:

Blurred placeholder:

Reading the computed options string directly (PHP 8.4 property hook):


Legacy string API

Raw imgproxy option strings are still accepted by both the helper and the facade — no breaking changes:


All versions of laravel-imgproxy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/support Version ^11.0|^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rikodev/laravel-imgproxy contains the following files

Loading the files please wait ...