PHPackages                             mr-timofey/laravel-aio-images - 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. [Database &amp; ORM](/categories/database)
4. /
5. mr-timofey/laravel-aio-images

ActiveLibrary[Database &amp; ORM](/categories/database)

mr-timofey/laravel-aio-images
=============================

All-in-one Laravel image processing

0.3.0(6y ago)34.1k↓100%11MITPHPPHP &gt;=7.1.0

Since Nov 29Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mrTimofey/laravel-aio-images)[ Packagist](https://packagist.org/packages/mr-timofey/laravel-aio-images)[ RSS](/packages/mr-timofey-laravel-aio-images/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (17)Used By (1)

All-in-one Laravel image processing
===================================

[](#all-in-one-laravel-image-processing)

This package includes the following:

- images database table migration;
- images Eloquent model;
- controller for uploads and on-the-fly/on-demand image processing/caching;
- service provider.

Any uploaded or generated image is automatically optimized using the [spatie/image-optimizer](https://github.com/spatie/image-optimizer) package.

On-the-fly image generation just uses [intervention/image](http://image.intervention.io/) package.

Requirements
------------

[](#requirements)

- PHP 7.1
- Laravel or Lumen 5

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

[](#installation)

```
sudo apt-get install pngquant gifsicle jpegoptim optipng
composer require mr-timofey/laravel-aio-images
```

### Laravel

[](#laravel)

```
php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"
php artisan vendor:publish --provider="MrTimofey\LaravelAioImages\ServiceProvider"
php artisan migrate
```

**Migration will create the `aio_images` table which contains a `json` field `props`. You can change it to `text` if your database does not support JSON/JSONB fields. Although it is not recommended.**

If you want to use `storage/app/public` as a place to store all your images (configured by default):

```
php artisan storage:link
```

**For Laravel &lt;= 5.4** add `Intervention\Image\ImageServiceProvider`, `MrTimofey\LaravelAioImages\ServiceProvider`to your `app.providers` config.

See `config/aio_images.php` file for a further configuration instructions. **Do not forget to configure `aio_images.pipes`!**

### Lumen

[](#lumen)

Add `Intervention\Image\ImageServiceProviderLumen`, `MrTimofey\LaravelAioImages\ServiceProvider`service providers to `bootstrap/app.php`.

Copy contents of [config.php](https://raw.githubusercontent.com/mrTimofey/laravel-aio-images/master/config.php)to `config/aio_images.php`.

Create a migration `php artisan make:migration create_aio_images_table` and copy contents from [here](https://raw.githubusercontent.com/mrTimofey/laravel-aio-images/master/migrations/2000_01_01_000000_create_aio_images_table.php)to the just created migration file (`database/migrations/xxxx_xx_xx_xxxxxx_create_aio_images_table`).

See `config/aio_images.php` file for a further configuration instructions. **Do not forget to configure `aio_images.pipes`!**

Predefined routes
-----------------

[](#predefined-routes)

- `route('aio_images.upload')`, `POST multipart/form-data` - image uploads handler. Both multiple and single image uploads are supported. Field names does not matter since the controller just uses `Illuminate\Http\Request@allFiles()` to get your uploads.
- `route('aio_images.original', $image_id)` - original image path.
- `route('aio_images.pipe', [$pipe, $image_id])` - processed image path.

Usage example:
--------------

[](#usage-example)

```
// add relation to a table
/** @var Illuminate\Database\Schema\Blueprint $table */
$table->string('avatar_image_id')->nullable();
$table->foreign('avatar_image_id')
	->references('id')
	->on('aio_images')
	->onDelete('set null');

// add relation to a model
public function avatarImage()
{
	$model->belongsTo(ImageModel::class, 'avatar_image_id');
}

// create pipe config in config/aio_images.php
[
	// ...
	'pipes' => [
		// /storage/images/avatar/image-id.jpg
		'avatar' => [
			// $interventionImage->fit(120)
			['fit', 120],
			// $interventionImage->greyscale()
			['greyscale']
		]
	]
];

// display original avatar
echo '';
// display 120x120 squared grey colored avatar
echo '';

// same with ImageModel instance
echo '';
echo '';

// upload image manually from any of your custom controllers

use Illuminate\Http\Request;
use MrTimofey\LaravelAioImages\ImageModel;

function upload(Request $req)
{
	return ImageModel::upload($req->file('image'));
}
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 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 ~59 days

Recently: every ~197 days

Total

16

Last Release

2201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7864648122cd40602afa69f5bdf577684ae09f199ea2ab418c32005294bf89a2?d=identicon)[mrTimofey](/maintainers/mrTimofey)

---

Top Contributors

[![mrTimofey](https://avatars.githubusercontent.com/u/7373909?v=4)](https://github.com/mrTimofey "mrTimofey (43 commits)")

---

Tags

databasedatabase-migrationseloquentimageimage-manipulationimage-processingimagemagickimageslaravellaravel-5-packagelaravel-packagelaravel5lumenmodellaravelthumbnailimagegdimagickresizewatermarkoptimizegreyscale

### Embed Badge

![Health badge](/badges/mr-timofey-laravel-aio-images/health.svg)

```
[![Health](https://phpackages.com/badges/mr-timofey-laravel-aio-images/health.svg)](https://phpackages.com/packages/mr-timofey-laravel-aio-images)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[intervention/image-laravel

Laravel Integration of Intervention Image

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

Image manipulation library for Laravel 5 based on Imagine and inspired by Croppa for easy url based manipulation

270248.2k5](/packages/folklore-image)[intervention/image-symfony

Symfony Integration of Intervention Image

1066.8k](/packages/intervention-image-symfony)

PHPackages © 2026

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