PHPackages                             bst27/laravel-image-proxy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. bst27/laravel-image-proxy

ActiveLibrary[Image &amp; Media](/categories/media)

bst27/laravel-image-proxy
=========================

A Laravel image proxy to cache, minify and modify images very easily.

v0.4.0(11mo ago)2401—0%MITPHPCI passing

Since Jun 15Pushed 11mo agoCompare

[ Source](https://github.com/bst27/laravel-image-proxy)[ Packagist](https://packagist.org/packages/bst27/laravel-image-proxy)[ RSS](/packages/bst27-laravel-image-proxy/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (4)Versions (5)Used By (0)

Laravel Image Proxy
===================

[](#laravel-image-proxy)

[![Latest Version on Packagist](https://camo.githubusercontent.com/868bb595b12cc1bca5f82e798a72fe7c1d1aaaf98ea5623090f4dd9df72e8665/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62737432372f6c61726176656c2d696d6167652d70726f78792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bst27/laravel-image-proxy)[![Tests](https://github.com/bst27/laravel-image-proxy/workflows/CI/badge.svg)](https://github.com/bst27/laravel-image-proxy/workflows/CI/badge.svg)[![Total Downloads](https://camo.githubusercontent.com/f6b3c209973239e6e9754249ba7cbcd7ff9aba9edf1691ed6042032c7a1b4677/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62737432372f6c61726176656c2d696d6167652d70726f78792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bst27/laravel-image-proxy)

A Laravel image proxy to cache, minify and manipulate images very easily.

Features
--------

[](#features)

- Automatic image compression / minification
- Automatic caching of images on host and client side
- Flexible storage options (local, S3, SFTP etc.)
- Optional: image manipulation (resizing etc.)
- Optional: custom image filename in URL
- Easily extendable with custom strategies for image manipulation

---

Installation
------------

[](#installation)

```
composer require bst27/laravel-image-proxy
```

Per default [spatie/image-optimizer](https://github.com/spatie/image-optimizer) is used to compress images. So make sure you install the required dependencies as described in their docs.

---

Usage
-----

[](#usage)

Use the global helper function `proxy_image()` to generate a secure image URL:

```

```

This will automatically minify and cache the image and generate something like this:

```

```

You can also define a strategy and filename for image manipulation:

```

```

This will use the `default` strategy for image manipulation, keep the given filename and generate something like this:

```

```

---

Manipulation Strategies
-----------------------

[](#manipulation-strategies)

To manipulate images, you can configure different strategies in [config/image-proxy.php](config/image-proxy.php). The [DefaultManipulator](src/Services/ImageManipulator/DefaultManipulator.php) strategy uses [spatie/image-optimizer](https://github.com/spatie/image-optimizer) to compress images.

```
'manipulation_strategy' => [
    'default' => [
        'class'  => \Bst27\ImageProxy\Services\ImageManipulator\DefaultManipulator::class,
        'params' => [],
    ],
],
```

Each strategy class must implement the [ImageManipulator](src/Contracts/ImageManipulator.php) contract. You can add your own image manipulation strategy easily:

1. Implement the contract interface
2. Add your manipulator to the `manipulation_strategy` array of the `image-proxy.php` with a unique strategy key.
3. Start using it by calling `proxy_image()` with your strategy key.

---

Endpoints
---------

[](#endpoints)

Two routes are registered automatically:

- Short URL:
    `/img/{token}.{ext}`
- Named URL:
    `/img/{token}/{filename}`

URLs to these routes are generated via `proxy_image()` and require a valid encrypted payload token. You can customize them via the config.

---

Storage
-------

[](#storage)

[Flysystem](https://github.com/thephpleague/flysystem) is used to offer flexible storage options. Per default the original images are read from the `local` storage disk. The cached images are stored on the `local` storage disk, too. You can customize the used storage disks using the plugin config or environment settings.

---

Configuration
-------------

[](#configuration)

Check [image-proxy.php](config/image-proxy.php) for default config. You can customize config via environment variables or publish the config file:

```
php artisan vendor:publish --provider="Bst27\ImageProxy\ImageProxyServiceProvider"
```

This will create `config/image-proxy.php`.

---

Tests
-----

[](#tests)

To run tests, you can execute the following command:

```
docker run --rm -it \
  -u "$(id -u):$(id -g)" \
  -v "$PWD":/var/www/html \
  -w /var/www/html \
  laravelsail/php84-composer:latest \
  php vendor/bin/phpunit
```

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance52

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

337d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6805736?v=4)[Bastian](/maintainers/bst27)[@bst27](https://github.com/bst27)

---

Top Contributors

[![bst27](https://avatars.githubusercontent.com/u/6805736?v=4)](https://github.com/bst27 "bst27 (14 commits)")

---

Tags

imageproxylaravellaravel-packageminifier

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/bst27-laravel-image-proxy/health.svg)

```
[![Health](https://phpackages.com/badges/bst27-laravel-image-proxy/health.svg)](https://phpackages.com/packages/bst27-laravel-image-proxy)
```

###  Alternatives

[spatie/image

Manipulate images with an expressive API

1.4k54.4M138](/packages/spatie-image)[spatie/laravel-image-optimizer

Optimize images in your Laravel app

1.3k6.5M43](/packages/spatie-laravel-image-optimizer)[justbetter/statamic-image-optimize

Image optimization after upload

1315.2k](/packages/justbetter-statamic-image-optimize)[sukohi/surpass

A PHP package mainly developed for Laravel to manage uploading images using Ajax and displaying thumbnail.

283.8k](/packages/sukohi-surpass)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
