PHPackages                             amostajo/laravel-image-handler - 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. amostajo/laravel-image-handler

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

amostajo/laravel-image-handler
==============================

Package provides laravel with Image Handler class, perfect to create thumbs, resize or crop images.

1.0.1(10y ago)51.3k6[1 PRs](https://github.com/amostajo/laravel-image-handler/pulls)MITPHPPHP &gt;=5.4

Since Jul 2Pushed 9y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

IMAGE HANDLER (for Laravel 5)
-----------------------------

[](#image-handler-for-laravel-5)

[![Latest Stable Version](https://camo.githubusercontent.com/2d518a43519d147cce7888c8e4e06b64d375d8af10fb9413e11b6c7a1f06a974/68747470733a2f2f706f7365722e707567782e6f72672f616d6f7374616a6f2f6c61726176656c2d696d6167652d68616e646c65722f762f737461626c65)](https://packagist.org/packages/amostajo/laravel-image-handler)[![Total Downloads](https://camo.githubusercontent.com/0f83c6dfe9f48e8d56294260391b83dda4bb1956ee4b4057029508007470eba7/68747470733a2f2f706f7365722e707567782e6f72672f616d6f7374616a6f2f6c61726176656c2d696d6167652d68616e646c65722f646f776e6c6f616473)](https://packagist.org/packages/amostajo/laravel-image-handler)[![License](https://camo.githubusercontent.com/1b599c4b701e250be2d2aa292e0d8f3eaa0353edbb120bcaed9df153611595a4/68747470733a2f2f706f7365722e707567782e6f72672f616d6f7374616a6f2f6c61726176656c2d696d6167652d68616e646c65722f6c6963656e7365)](https://packagist.org/packages/amostajo/laravel-image-handler)

Image handling solution for [Laravel 5](http://laravel.com/), creates thumbs on the fly, handles image cropping, upscaling and resizing.

Works with **Laravel 5.1**.

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

[](#installation)

Add

```
"amostajo/laravel-image-handler": "1.0.1"
```

to your `composer.json`. Then run `composer install` or `composer update`.

Then in your `config/app.php` add

```
Amostajo\LaravelImageHandler\Providers\ImageHandlerProvider::class,
```

in the providers array.

Then add

```
'ImageHandler'      => Amostajo\LaravelImageHandler\Facades\ImageHandler::class,
```

in the `aliases` array.

Copy and rename the config file `[package]\config\config.php` to your laravel's config directory `[root]\config\image.php`.

Usage
-----

[](#usage)

Creating a thumb for an image have never been this easy:

```
// $imageUrl is exactly that, an image url.
// From either your own website or from an external source.
$url = ImageHandler::thumb($imageUrl);
```

**ImageHandler** will actually create a thumb and place it in `public/thumbs` directory.

The returned `$url` can be placed in a `img` html tag like this (sample using blade):

```

```

[![Thumb](https://camo.githubusercontent.com/e00993402435e2f0e395fc136a409ceb19f572865cd5d9b84ad9f89ce01dda4f/687474703a2f2f7331342e706f7374696d672e6f72672f366a30727a3230716c2f62656163685f313030783130302e6a7067)](https://camo.githubusercontent.com/e00993402435e2f0e395fc136a409ceb19f572865cd5d9b84ad9f89ce01dda4f/687474703a2f2f7331342e706f7374696d672e6f72672f366a30727a3230716c2f62656163685f313030783130302e6a7067)

The thumb created will always be cropped to fit the desired size. By default, the thumb will be cropped to the width and height specified in the configuration file, although you can easily set these as parameters:

```

```

[![Thumb](https://camo.githubusercontent.com/f3f72bad6b0ab8e0f3ae19c682a094ba8b7bf734e35dd3d390a16373ba31588c/687474703a2f2f7332322e706f7374696d672e6f72672f77766366396e7938312f62656163685f383030783138302e6a7067)](https://camo.githubusercontent.com/f3f72bad6b0ab8e0f3ae19c682a094ba8b7bf734e35dd3d390a16373ba31588c/687474703a2f2f7332322e706f7374696d672e6f72672f77766366396e7938312f62656163685f383030783138302e6a7067)

If you don't want the image to be cropped, prefer to keep constraints and just resize, use these methods instead:

```
// Resized / scaled to a specific width
$url = ImageHandler::width($imageUrl);

// Resized / scaled to a specific height
$url = ImageHandler::height($imageUrl);
```

```

```

[![Thumb](https://camo.githubusercontent.com/1e0144342b1526024f1a478de99cf01642897285cf199498ecc4374abf18ecb6/687474703a2f2f73392e706f7374696d672e6f72672f7a336e707077797a332f73686565705f333530782e6a7067)](https://camo.githubusercontent.com/1e0144342b1526024f1a478de99cf01642897285cf199498ecc4374abf18ecb6/687474703a2f2f73392e706f7374696d672e6f72672f7a336e707077797a332f73686565705f333530782e6a7067)

```

```

[![Thumb](https://camo.githubusercontent.com/b1f2b337b2fd6df681786eeb079ff723ca6756a38415b2065b8bae87426ba522/687474703a2f2f7333302e706f7374696d672e6f72672f6d6939663030656b682f73686565705f783335302e6a7067)](https://camo.githubusercontent.com/b1f2b337b2fd6df681786eeb079ff723ca6756a38415b2065b8bae87426ba522/687474703a2f2f7333302e706f7374696d672e6f72672f6d6939663030656b682f73686565705f783335302e6a7067)

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

[](#configuration)

Modify the configuration file to adjust the default thumb sizes, set the name of the folder path for the thumbs to be stored and more.

License
-------

[](#license)

This package is free software distributed under the terms of the MIT license.

Additional Information
----------------------

[](#additional-information)

This package uses [php-image-resize](https://github.com/eventviva/php-image-resize).

### Image credits

[](#image-credits)

[Beach](http://beachgrooves.com/wp-content/uploads/2014/07/beach.jpg)Taken from  on 1st of July of 2015.

[Sheep](http://static.guim.co.uk/sys-images/Guardian/Pix/pictures/2014/4/11/1397210130748/Spring-Lamb.-Image-shot-2-011.jpg)Taken from  on 1st of July of 2015.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

2

Last Release

3973d ago

### Community

Maintainers

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

---

Tags

laravelimagehandlingresizehandlerimagesthumbcropthumbs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amostajo-laravel-image-handler/health.svg)

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

###  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

1536.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)[jbzoo/image

A PHP class that simplifies working with images

171126.9k3](/packages/jbzoo-image)[reliqarts/laravel-guided-image

Simplified and ready image manipulation for Laravel via intervention image.

351.4k](/packages/reliqarts-laravel-guided-image)[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)

PHPackages © 2026

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