PHPackages                             creode/laravel-image-optimiser - 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. creode/laravel-image-optimiser

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

creode/laravel-image-optimiser
==============================

2.1.0(1y ago)062[1 PRs](https://github.com/creode-modules/laravel-image-optimiser/pulls)PHP

Since Nov 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/creode-modules/laravel-image-optimiser)[ Packagist](https://packagist.org/packages/creode/laravel-image-optimiser)[ RSS](/packages/creode-laravel-image-optimiser/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (16)Used By (0)

Laravel Image Optimiser
=======================

[](#laravel-image-optimiser)

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

[](#installation)

Package can be installed on a Laravel Project via composer.

```
composer require creode/laravel-image-optimiser
```

Versions
--------

[](#versions)

This package utilises the Intervention Image Library behind the scenes and attempts to keep up to date with it. The following table shows the versions of the package and the versions of the Intervention Image Library that they use.

Package VersionIntervention Version1.0.\*2.7.\*2.0.\*3.\*Configuration
-------------

[](#configuration)

The package can be configured by publishing the config file.

```
php artisan vendor:publish --tag="image-optimiser-config"
```

This will create a new file in your config directory called `image-optimiser.php`. This file contains all the configuration options for the package.

Usage
-----

[](#usage)

This package aims to expose a simple route that allows you to optimise images on the fly. The route is `/image/{preset}` and will return the optimised image. The url/path of the image will be passed to the optimiser as a query parameter.

### Rendering the image

[](#rendering-the-image)

In order to render the optimised image inside of a blade template, you can use the following code:

```
{{ route('optimise-image', ['preset' => 'large', 'url' => $media->url]) }}

```

### Caching

[](#caching)

In order to save on processing for each image, the package will cache the optimised image. The cache is stored in Laravel's cache system and the lifetime can be configured in the `image-optimiser.php` config file. The cache is stored for 1 year by default. Passing null as the cache lifetime will disable the cache.

Extending
---------

[](#extending)

The package is designed to be extended to allow for different optimisation methods to be created and used. To do this you need to create a new class that implements the `Modules\ImageOptimiser\app\Concerns\OptimiserInterface` interface. This interface has only a single `optimise` method to be implemented.

Once that has been done, you just need to publish configuration for the package and update the `image-optimiser.php` config option to point to your new class.

Alternatively, you can override the `optimiser` service in the `image-optimiser.php` config file and point it to your new class.

```
$this->app->singleton('optimiser', function () {
    return new MyNewOptimiserClass();
});
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.3% 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 ~15 days

Recently: every ~5 days

Total

13

Last Release

725d ago

Major Versions

1.x-dev → 2.0.02023-12-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8133041?v=4)[Creode](/maintainers/creode)[@creode](https://github.com/creode)

---

Top Contributors

[![jaymeh](https://avatars.githubusercontent.com/u/18261676?v=4)](https://github.com/jaymeh "jaymeh (21 commits)")[![creode-dev](https://avatars.githubusercontent.com/u/19706903?v=4)](https://github.com/creode-dev "creode-dev (2 commits)")

### Embed Badge

![Health badge](/badges/creode-laravel-image-optimiser/health.svg)

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

###  Alternatives

[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[jenssegers/imagehash

Perceptual image hashing for PHP

2.1k2.2M5](/packages/jenssegers-imagehash)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[lasserafn/php-initial-avatar-generator

A package to generate avatars with initials for PHP

4374.2M13](/packages/lasserafn-php-initial-avatar-generator)[rtippin/messenger

Laravel messenger suite.

45035.8k4](/packages/rtippin-messenger)

PHPackages © 2026

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