New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

amostajo/laravel-image-handler

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

Larablocks Analysis

amostajo/laravel-image-handler works with Laravel 5 (latest release 1.0.1, Jul 2, 2015), which reached end of life: no more fixes, even for security.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • Supports only Laravel 5, past end of life
  • No release in the last 12 months (last: Jul 2, 2015)
  • 0 downloads a month (needs 10,000)
  • 5 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 2, 2015.
  • No releases in the last 12 months.
  • First released: Jul 2, 2015.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 1, 2026.

Install
composer require amostajo/laravel-image-handler
Latest Version:1.0.1
PHP:>=5.4
Laravel:5
License:MIT
Last Updated:Jan 9, 2017
Links: GitHub  ·  Packagist
Maintainer: amostajo

IMAGE HANDLER (for Laravel 5)

Latest Stable Version Total Downloads License

Image handling solution for Laravel 5, creates thumbs on the fly, handles image cropping, upscaling and resizing.

Works with Laravel 5.1.

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

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):

<img src="https://raw.githubusercontent.com/amostajo/laravel-image-handler/HEAD/{{ ImageHandler::thumb($imageUrl) }}"/>

Thumb

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:

<img src="https://raw.githubusercontent.com/amostajo/laravel-image-handler/HEAD/{{ ImageHandler::thumb($imageUrl, 800, 180) }}"/>

Thumb

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);
<img src="https://raw.githubusercontent.com/amostajo/laravel-image-handler/HEAD/{{ ImageHandler::width($imageUrl, 350) }}"/>

Thumb

<img src="https://raw.githubusercontent.com/amostajo/laravel-image-handler/HEAD/{{ ImageHandler::height($imageUrl, 350) }}"/>

Thumb

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

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

Additional Information

This package uses php-image-resize.

Image credits

Beach Taken from http://beachgrooves.com on 1st of July of 2015.

Sheep Taken from https://guim.co.uk on 1st of July of 2015.

Alternatives to amostajo/laravel-image-handler

intervention/image

PHP Image Processing

245,758,983 14,392
mostafaznv/larupload

Larupload is a ORM based file uploader for laravel to upload image, video, audio...

611,485 76
bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

545,042 510
folklore/laravel-image

On-the-fly image renditions for Laravel: presets, signed URLs and responsive var...

10,712 4
ctessier/nova-advanced-image-field

An advanced image field for Nova with cropping and resizing.

593,254 102

Version History

Version Released PHP Laravel License
1.0.1 >=5.4 ~5.0 MIT
v1.0.0 >=5.4 ~5.0 MIT