PHPackages                             unglud/laravel-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. [File &amp; Storage](/categories/file-storage)
4. /
5. unglud/laravel-image

AbandonedLibrary[File &amp; Storage](/categories/file-storage)

unglud/laravel-image
====================

Basic image saver for Laravel 5

v2.0(7y ago)128361MITPHPPHP ^7.1

Since May 2Pushed 7y ago2 watchersCompare

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

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

laravel-image
=============

[](#laravel-image)

Basic image saver for Laravel 5.

If you need save uploaded image to some place and to a database, the best way to do that is to save an image in public folder with the unique name and then save that name to the database.

So this package will do it for you.

[![GitHub release](https://camo.githubusercontent.com/21fe23778b1c73efad81206de62d0dcd975d1391ece62509c40c70f05946d487/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f756e676c75642f6c61726176656c2d696d6167652e737667)](https://github.com/unglud/laravel-image/releases)[![Build Status](https://camo.githubusercontent.com/5511e84df0ecf298c7862bc0f0d1b3ab275ceb2ccbff7faa24052c4e0f7e62b4/68747470733a2f2f7472617669732d63692e6f72672f756e676c75642f6c61726176656c2d696d6167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/unglud/laravel-image)[![License](https://camo.githubusercontent.com/fdaffc0a8d8354e1f54e65ef77bceac4647afd16abb02d31e6cfc607473e37b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f756e676c75642f6c61726176656c2d696d6167652e737667)](https://github.com/unglud/laravel-image/blob/master/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/80f404f116d84368b7ef0e7dbc629bbd9473a42f7c254f4e3cca728e2b17b7c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756e676c75642f6c61726176656c2d696d6167652e737667)](https://packagist.org/packages/unglud/laravel-image)

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

[](#installation)

Laravel Image is distributed as a composer package:

```
composer require unglud/laravel-image

```

If you want to change configs later, please publish config file first:

```
php artisan vendor:publish

```

Afterward, you can edit the file `config/lavaimage.php`.

Saving Image
------------

[](#saving-image)

Use `LavaImage::save()` to save image to `public/uploads`, this method generate unique 8 char filename and put file to [deep tree folder structure](http://serverfault.com/a/95454).

```
use Unglued\LavaImage\Facades\LavaImage;

$fileHash = LavaImage::save('http://lorempixel.com/300/300/');

// $fileHash == 203bad62
// and file stored in /public/uploads/2/0/203bad62.jpg

// now you can save hash to file in your storage
$myModel = new MyModel();
$myModel->image = $fileHash;
$myModel->save();
```

### File structure

[](#file-structure)

You can specify another folder structure, like any depth or folder name length in the config file

```
for 203bad62 it can be
/2/0/203bad62.jpg
/2/0/3/b/203bad62.jpg
/20/203bad62.jpg
/20/3b/203bad62.jpg
etc....

```

### Crop and save

[](#crop-and-save)

You can specify size as second argument for center fit cropping

```
LavaImage::save('http://lorempixel.com/300/300/', [100,100]);
```

As the first argument, you can pass any data, what [Intervention/image make method](http://image.intervention.io/api/make) support

```
// save image from file
LavaImage::save('public/foo.jpg');

// or save image from binary data
LavaImage::save(file_get_contents('public/foo.jpg'));

// save image from gd resource
LavaImage::save(imagecreatefromjpeg('public/foo.jpg'));

// save image directly from an url
LavaImage::save('http://example.com/example.jpg');

// save image directly from Laravel file upload
LavaImage::save(Input::file('photo'));
```

Any time after saving you can retrieve generated hash by `LavaImage::getImageCode()`

Getting Image
-------------

[](#getting-image)

Then you need to get an image, use hash you know

```
$hash = '203bad62'
LavaImage::getImage($hash);
// will return http://example.com/uploads/2/0/203bad62.jpg

LavaImage::getImage($hash, true);
// will return absolute path /home/var/laravel/public/uploads/2/0/203bad62.jpg
```

License
-------

[](#license)

Laravel Image is released under the MIT Licence. See the bundled LICENSE file for details.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

2882d ago

Major Versions

v0.1.1 → v1.0.02015-05-02

v1.1.1 → v2.02018-06-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b85dea7921dfab50a27316ef0644ec31206302e9cb6c08557802ac4e7ea1632?d=identicon)[unglued](/maintainers/unglued)

---

Top Contributors

[![unglud](https://avatars.githubusercontent.com/u/1012620?v=4)](https://github.com/unglud "unglud (7 commits)")

---

Tags

laravelimagefileuploadsave

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[mafftor/laravel-file-manager

The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox

3619.3k](/packages/mafftor-laravel-file-manager)

PHPackages © 2026

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