Download the PHP package rafoabbas/laravel-image-proxy without Composer

On this page you can find all versions of the php package rafoabbas/laravel-image-proxy. 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-image-proxy

Laravel Image Proxy

On-the-fly image transformation, AVIF/WebP conversion, and caching proxy for Laravel.

Features

Requirements

Installation

The package auto-discovers its service provider. Publish the config file:

Configuration

After publishing, edit config/image-proxy.php:

Usage

Basic

Once installed, images are served through the /img/{path} route:

This reads photos/landscape.jpg from the configured source disk, converts it to the best format supported by the client (AVIF > WebP), caches the result, and returns it with proper Cache-Control, ETag, Vary, and Content-Type headers.

Query Parameters

Parameter Type Description
w int Target width (clamped to max_width)
h int Target height (clamped to max_height)
fit string Resize mode: crop for cover-fit
q int Output quality (clamped between min/max)
lqip bool Return a 20px low-quality placeholder
blur int Blur radius, 0–max_blur (default 50)
sharpen int Sharpen amount, 0–100
grayscale bool Convert to grayscale
brightness int Brightness adjustment, -100 to 100
contrast int Contrast adjustment, -100 to 100
rotate int Rotation in degrees (mod 360)
flip string Flip: h (horizontal), v (vertical), both
watermark string Path to watermark image on watermark disk
watermark_position string Watermark position (see below)
watermark_alpha int Watermark opacity, 0–100 (default 50)
watermark_size int Watermark width as % of image, 1–100 (default 25)
watermark_padding int Watermark padding from edge, 0–100px (default 10)
focal_x float Focal point X, 0.0–1.0 (used with w + h)
focal_y float Focal point Y, 0.0–1.0 (used with w + h)
border_radius int Rounded corners in pixels (clamped to max_border_radius)
padding int Padding in pixels (clamped to max_padding)
bg string Background hex color for padding/rotation (e.g. ff0000 or f00)

Examples:

Effects

Apply visual effects to any image:

Combine effects with resize:

Rotation & Flip

The bg parameter sets the background color for areas exposed by rotation. Defaults to white.

Watermark

Overlay a watermark image on any processed image:

Watermark positions: top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right

Watermark images are read from the watermark_disk (falls back to source_disk). Returns 404 if the watermark file doesn't exist.

Focal Point Crop

Crop around a specific point of interest instead of the center:

Both focal_x and focal_y must be provided along with w and h. Values are clamped to 0.0–1.0, where (0,0) is the top-left corner and (1,1) is the bottom-right.

Border Radius & Padding

Add rounded corners and padding:

Generating URLs

Using the Facade

When URL signing is enabled, all URLs generated through the facade are automatically signed.

Using the Blade Directive

This generates a complete <img> tag with srcset, sizes, loading="lazy", and decoding="async" attributes.

Using Route Helper

Note: The route helper does not support signed URLs. Use the ImageProxy facade when signing is enabled.

URL Signing

Enable signed URLs to prevent unauthorized transformations:

When enabled, all requests must include a valid s parameter. URLs without a valid signature receive a 403 response.

Content Negotiation (AVIF/WebP)

The proxy automatically selects the best output format based on the client's Accept header:

  1. If the client supports AVIF and 'avif' is in the formats config → serves AVIF
  2. If the client supports WebP and 'webp' is in the formats config → serves WebP
  3. Falls back to the last format in the list

The response includes a Vary: Accept header for proper CDN caching.

Note: AVIF encoding with the GD driver requires PHP 8.1+ with libavif. The Imagick driver provides more reliable AVIF support.

LQIP (Low Quality Image Placeholder)

Request a tiny placeholder image for lazy loading:

This returns a 20px wide, quality-20 thumbnail (typically under 1KB) that can be used as a blur-up placeholder.

External URL Proxying

Add allowed domains to the config:

Then pass the full URL as the path:

The proxy includes SSRF protection: localhost, private IPs, and reserved ranges are blocked.

Remote Disk Caching

When using remote disks like S3 or R2 as the source, originals are automatically cached to the local cache disk. This avoids re-downloading the same file on subsequent requests with different transformation parameters.

Disable with 'cache_remote_originals' => false in the config.

Rate Limiting

The package does not include built-in rate limiting. Use Laravel's throttle middleware on the image proxy route:

Or apply more granular throttling with a custom rate limiter:

Cache Management

Clear the cache using the Artisan command:

Testing

Code Style

License

MIT


All versions of laravel-image-proxy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/routing Version ^10.0|^11.0|^12.0|^13.0
intervention/image Version ^3.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 rafoabbas/laravel-image-proxy contains the following files

Loading the files please wait ...