PHPackages                             vinterskogen/laravel-uploaded-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. vinterskogen/laravel-uploaded-image

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

vinterskogen/laravel-uploaded-image
===================================

Gracefully deal with resizing, cropping and scaling uploaded images in Laravel apps

0.1.12(8y ago)131611MITPHPPHP &gt;=7.0

Since Sep 11Pushed 4y ago2 watchersCompare

[ Source](https://github.com/vinterskogen/laravel-uploaded-image)[ Packagist](https://packagist.org/packages/vinterskogen/laravel-uploaded-image)[ RSS](/packages/vinterskogen-laravel-uploaded-image/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (8)Dependencies (6)Versions (10)Used By (0)

Uploaded image for Laravel
==========================

[](#uploaded-image-for-laravel)

[![Build Status](https://camo.githubusercontent.com/dc484ed0c24a606e45f827d001d7843fe7f793dbb49476e58b3700b7a86f9e16/68747470733a2f2f7472617669732d63692e6f72672f76696e746572736b6f67656e2f6c61726176656c2d75706c6f616465642d696d6167652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/vinterskogen/laravel-uploaded-image)[![StyleCI](https://camo.githubusercontent.com/a7452c1befee0293e8a4bf8d8fafdacd837c177688d6dc0f1d12dd8a5aa20485/68747470733a2f2f7374796c6563692e696f2f7265706f732f3130333037323736382f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/103072768)[![Latest Stable Version](https://camo.githubusercontent.com/a84d4c53c7d8af3819cadade2064f8b49df7cd03277b9b85ef99cb7b8ef6789f/68747470733a2f2f706f7365722e707567782e6f72672f76696e746572736b6f67656e2f6c61726176656c2d75706c6f616465642d696d6167652f762f737461626c65)](https://packagist.org/packages/vinterskogen/laravel-uploaded-image)

[![](https://user-images.githubusercontent.com/8015372/30301362-f65eec58-9762-11e7-86cc-72137c48ba87.png)](https://github.com/vinterskogen/laravel-uploaded-image)

Gracefully deal with resizing, cropping and scaling uploaded images in Laravel apps.

About
-----

[](#about)

This package allows you to retrieve an uploaded image object from request, apply manipulations over the image content and then place the result to file storage in a few lines of code.

Under the hood this package is using [Intervention Image](http://image.intervention.io/) - a PHP image handling and manipulation library.

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

[](#installation)

Install via Composer:

`composer require vinterskogen/laravel-uploaded-image`

Check the [Installation](docs/installation.md) page for full information about package requirements and notes.

Usage
-----

[](#usage)

For example your app has a controller that handles the users' avatars uploads and saves the avatar images to file storage. You want that avatars to fit to 250x150 pixels and to be encoded into PNG format.

This can be done as easy as:

```
$request->image('avatar')
        ->fit(250, 150)
        ->encode('png')
        ->store('images/users/avatars', 'public');
```

The `$request` object now have an `image` method, that works just like the `file` method - retrieves an image file from the input and returns it as an instance of `Vinterskogen\UploadedImage\Uploadedimage` class.

This class extends the Laravel's `Illuminate\Http\UploadedFile` and implements a number of helpful image handling methods.

> **Note**: to be sure the file you are going to handle like an image is actually an image file, you have to apply [form request validation](https://laravel.com/docs/master/validation#form-request-validation)constraints on your input (if you haven't done that yet, of course).

Image handling methods
----------------------

[](#image-handling-methods)

The list of public image handling methods that are available on `Uploadedimage`instance:

### Fit

[](#fit)

`fit(int $width, int $height)` – resize and crop the uploaded image to fit given width and height, keeping aspect ratio.

`fitSquare(int $size)` – resize and crop the uploaded image to fit a square with given side size, keeping aspect ratio.

### Crop

[](#crop)

`crop(int $width, int $height, int $x = null, int $y = null)` – crop uploaded image to given width and height.

### Encode

[](#encode)

`encode(string $format, int $quality = null)` – encode uploaded image in given format and quality.

### Scale

[](#scale)

`scale(int|float $percentage)` – scale the uploaded image size using given percentage.

### Resize to width

[](#resize-to-width)

`resizeToWidth(int $width)` – resize the uploaded image to new width, constraining aspect ratio.

### Resize to height

[](#resize-to-height)

`resizeToHeight(int $height)` – resize the uploaded image to new height, constraining aspect ratio.

### Height

[](#height)

`height()` – get height of uploaded image (in pixels).

### Width

[](#width)

`width()` – get width of uploaded image (in pixels).

License
-------

[](#license)

The MIT license. See the accompanying `LICENSE.md` file.

Credit
------

[](#credit)

Vinter Skogen, 2017-2022

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.4% 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 ~12 days

Recently: every ~21 days

Total

8

Last Release

3127d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8015372?v=4)[Vinter Skogen](/maintainers/vinterskogen)[@vinterskogen](https://github.com/vinterskogen)

---

Top Contributors

[![vinterskogen](https://avatars.githubusercontent.com/u/8015372?v=4)](https://github.com/vinterskogen "vinterskogen (37 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[intervention/image-laravel

Laravel Integration of Intervention Image

1558.1M161](/packages/intervention-image-laravel)[illuminate/routing

The Illuminate Routing package.

1239.0M2.9k](/packages/illuminate-routing)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4923.6k5](/packages/ralphjsmit-laravel-glide)

PHPackages © 2026

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