PHPackages                             reliqarts/laravel-guided-image - 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. reliqarts/laravel-guided-image

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

reliqarts/laravel-guided-image
==============================

Simplified and ready image manipulation for Laravel via intervention image.

v5.1.2(1y ago)351.4k↓45%3MITPHPPHP ^8.2CI passing

Since Oct 23Pushed 1y ago5 watchersCompare

[ Source](https://github.com/reliqarts/laravel-guided-image)[ Packagist](https://packagist.org/packages/reliqarts/laravel-guided-image)[ GitHub Sponsors](https://github.com/reliq)[ RSS](/packages/reliqarts-laravel-guided-image/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (10)Versions (52)Used By (0)

Laravel Guided Image
====================

[](#laravel-guided-image)

Guided Image is an image utility package for Laravel based on Intervention Image.

[![Built For Laravel](https://camo.githubusercontent.com/5eeeef36666bf2aefe6800cfd097832e37f96e2d2f2b944baf4744637b05c4c9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6275696c74253230666f722d6c61726176656c2d7265642e7376673f7374796c653d666c61742d737175617265)](http://laravel.com)[![Build Status (all)](https://camo.githubusercontent.com/b70ac8718e59735a968e37dddfb11e1178df6e67569f08143768c3c08c60df6c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f72656c6971617274732f6c61726176656c2d6775696465642d696d6167653f7374796c653d666c61742d737175617265)](https://travis-ci.com/reliqarts/laravel-guided-image)[![Scrutinizer](https://camo.githubusercontent.com/594d9c6c93a45ea805e1b1e9978ed4385f15cd65c2957a55424f7d3694326cc7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72656c6971617274732f6c61726176656c2d6775696465642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/reliqarts/laravel-guided-image/)[![Codecov](https://camo.githubusercontent.com/9ed2bd2d0d29513f9006f0bad554948b597446e26c094eba73703f148315e4ae/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f72656c6971617274732f6c61726176656c2d6775696465642d696d6167652e7376673f7374796c653d666c61742d737175617265)](https://codecov.io/gh/reliqarts/laravel-guided-image)[![Maintainability](https://camo.githubusercontent.com/0a7125886291cb04b0a71435d15892f272de506400a2bc6c9a7a7aaa86e226d4/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f36616330656636313565326539373930393938342f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/reliqarts/laravel-guided-image/maintainability)[![License](https://camo.githubusercontent.com/0fa2cfdfb91d56a226912da01b475c3a079124567c249a19a3cbd56b2fe38aec/68747470733a2f2f706f7365722e707567782e6f72672f72656c6971617274732f6c61726176656c2d6775696465642d696d6167652f6c6963656e73653f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/reliqarts/laravel-guided-image)[![Latest Stable Version](https://camo.githubusercontent.com/ee29176f044fa08838fa7eea3fb59c24f95cf6503cb4e7b9087f84dc47bc4aab/68747470733a2f2f706f7365722e707567782e6f72672f72656c6971617274732f6c61726176656c2d6775696465642d696d6167652f76657273696f6e3f666f726d61743d666c61742d737175617265)](https://packagist.org/packages/reliqarts/laravel-guided-image)[![Latest Unstable Version](https://camo.githubusercontent.com/881e51bb7b057ae288b24e62893d4738ce40993e1b84b6a1703d3c5a8576e7b2/68747470733a2f2f706f7365722e707567782e6f72672f72656c6971617274732f6c61726176656c2d6775696465642d696d6167652f762f756e737461626c653f666f726d61743d666c61742d737175617265)](//packagist.org/packages/reliqarts/laravel-guided-image)

[![Guided Image for Laravel](https://raw.githubusercontent.com/reliqarts/laravel-guided-image/main/docs/images/logo.png)](#)

Key Features
------------

[](#key-features)

- On-the-fly image resizing
- On-the-fly thumbnail generation
- Image uploading
- Smart image reuse; mitigating against double uploads and space resource waste.

Guided Image can be integrated seamlessly with your existing image model.

### Guided Routes

[](#guided-routes)

The package provides routes for generating resized/cropped/dummy images.

- Routes are configurable you you may set any middleware and prefix you want.
- Generated images are *cached to disk* to avoid regenerating frequently accessed images and reduce overhead.

### Image file reuse

[](#image-file-reuse)

For situations where different instances of models use the same image.

- The package provides a safe removal feature which allows images to be detached and only deleted from disk if not being used elsewhere.
- An overridable method is used to determine when an image should be considered *safe* to delete.

Installation &amp; Usage
------------------------

[](#installation--usage)

### Installation

[](#installation)

Install via composer; in console:

```
composer require reliqarts/laravel-guided-image

```

or require in *composer.json*:

```
{
    "require": {
        "reliqarts/laravel-guided-image": "^5.0"
    }
}
```

then run `composer update` in your terminal to pull it in.

Finally, publish package resources and configuration:

```
php artisan vendor:publish --provider="ReliqArts\GuidedImage\ServiceProvider"

```

You may opt to publish only configuration by using the `guidedimage-config` tag:

```
php artisan vendor:publish --provider="ReliqArts\GuidedImage\ServiceProvider" --tag="guidedimage-config"

```

### Setup

[](#setup)

Set the desired environment variables so the package knows your image model, controller(s), etc.

Example environment config:

```
GUIDED_IMAGE_MODEL=Image
GUIDED_IMAGE_CONTROLLER=ImageController
GUIDED_IMAGE_ROUTE_PREFIX=image
GUIDED_IMAGE_SKIM_DIR=images

```

These variables, and more are explained within the [config](https://github.com/ReliqArts/laravel-guided-image/blob/master/config/config.php) file.

And... it's ready! 👌

### Usage

[](#usage)

To *use* Guided Image you must do just that from your *Image* model. 😏

Implement the `ReliqArts\GuidedImage\Contract\GuidedImage` contract and use the `ReliqArts\GuidedImage\Concern\Guided` trait, e.g:

```
use Illuminate\Database\Eloquent\Model;
use ReliqArts\GuidedImage\Concern\Guided;
use ReliqArts\GuidedImage\Contract\GuidedImage;

class Image extends Model implements GuidedImage
{
    use Guided;

    // ... properties and methods
}
```

See example [here](https://github.com/ReliQArts/laravel-guided-image/blob/master/docs/examples/Image.php).

Implement the `ReliqArts\GuidedImage\Contract\ImageGuide` contract and use the `ReliqArts\GuidedImage\Concern\Guide` trait from your *ImageController*, e.g:

```
use ReliqArts\GuidedImage\Contract\ImageGuide;
use ReliqArts\GuidedImage\Concern\Guide;

class ImageController extends Controller implements ImageGuide
{
    use Guide;
}
```

See example [here](https://github.com/ReliQArts/laravel-guided-image/blob/master/docs/examples/ImageController.php).

#### Features

[](#features)

##### Safely Remove Image (dissociate &amp; conditionally delete the image)

[](#safely-remove-image-dissociate--conditionally-delete-the-image)

An guided image instance is removed by calling the *remove* method. e.g:

```
$oldImage->remove($force);
```

`$force` is optional and is `false` by default.

##### Link Generation

[](#link-generation)

You may retrieve guided links to resized or cropped images like so:

```
// resized image:
$linkToImage = $image->routeResized([
    '550',      // width
    '_',        // height, 'null' is OK
    '_',        // keep aspect ratio? true by default, 'null' is OK
    '_',        // allow upsize? false by default, 'null' is OK
]);

// thumbnail:
$linkToImage = $image->routeThumbnail([
    'crop',     // method: crop|fit
    '550',      // width
    '_',        // height
]);
```

**NB:** In the above example `_` resolves to `null`.

Have a look at the [GuidedImage contract](https://github.com/ReliQArts/laravel-guided-image/blob/master/src/Contract/GuidedImage.php) for more info on model functions.

For more info on controller functions see the [ImageGuide contract](https://github.com/reliqarts/laravel-guided-image/blob/master/src/Contract/ImageGuide.php).

##### Routes

[](#routes)

Your actually routes will depend heavily on your custom configuration. Here is an example of what the routes may look like:

```
|| GET|HEAD | image/.dum//{width}-{height}/{color?}/{fill?}           | image.dummy           | App\Http\Controllers\ImageController@dummy       | web |
|| GET|HEAD | image/.res/{image}//{width}-{height}/{aspect?}/{upSize?}| image.resize          | App\Http\Controllers\ImageController@resized     | web |
|| GET|HEAD | image/.tmb/{image}//m.{method}/{width}-{height}         | image.thumb           | App\Http\Controllers\ImageController@thumb       | web |
|| GET|HEAD | image/empty-cache                                       | image.empty-cache     | App\Http\Controllers\ImageController@emptyCache  | web |

```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance46

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity89

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 98% 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 ~61 days

Recently: every ~95 days

Total

51

Last Release

419d ago

Major Versions

v1.1.1 → v2.0.0-beta2019-03-24

v2.0.4 → v3.0.02020-03-04

v3.3.1 → v4.0.02020-10-21

v4.4.2 → v5.0.02024-05-23

PHP version history (7 changes)v1.0.0PHP &gt;=5.6.4

v1.1.0PHP ^7.1.3

v2.0.0-beta.1PHP &gt;=7.1.3

v2.0.0-beta.4PHP ^7.2

v3.0.0PHP ^7.4

v4.2.0PHP ^7.4 || ^8.0

v5.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6fe8ddd9e024531dab6ec959ec29afc5cca84bb2129dc5405ff8f443bb19672?d=identicon)[Reliq](/maintainers/Reliq)

---

Top Contributors

[![reliq](https://avatars.githubusercontent.com/u/2624812?v=4)](https://github.com/reliq "reliq (239 commits)")[![jpedryc](https://avatars.githubusercontent.com/u/38433190?v=4)](https://github.com/jpedryc "jpedryc (4 commits)")[![gggordon](https://avatars.githubusercontent.com/u/6540335?v=4)](https://github.com/gggordon "gggordon (1 commits)")

---

Tags

hacktoberfestintervention-imagelaravellaravel-6laravel-6-packagelaravel-7laravel-7-packagelaravel-8laravel-8-packageroutingtraituploadviewlaravelimageresizeDummythumblaravel5photoroutecropgeneration

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/reliqarts-laravel-guided-image/health.svg)

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

###  Alternatives

[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k23](/packages/bkwld-croppa)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[ctessier/nova-advanced-image-field

An advanced image field for Nova with cropping and resizing.

103548.4k1](/packages/ctessier-nova-advanced-image-field)[ayvazyan10/nova-imagic

Imagic is a Laravel Nova field package that allows for image manipulation capabilities, such as cropping, resizing, quality adjustment, and WebP conversion. It utilizes the powerful Intervention Image class for image manipulation.

144.3k1](/packages/ayvazyan10-nova-imagic)[spescina/imgproxy

An image proxy for Laravel

201.3k](/packages/spescina-imgproxy)

PHPackages © 2026

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