PHPackages                             nijwel/image-upload - 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. nijwel/image-upload

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

nijwel/image-upload
===================

Image upload package for Laravel

1.0.1(1y ago)060MITPHPPHP ^8.0

Since Nov 19Pushed 1y ago1 watchersCompare

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

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

nijwel/image-upload
===================

[](#nijwelimage-upload)

A simple and flexible PHP package for handling image uploads, resizing, and management.

Features
--------

[](#features)

- Upload images with support for multiple formats (JPEG, PNG, GIF, WEBP).
- Resize images while maintaining aspect ratio.
- Save images with dynamic filenames and custom paths.

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

[](#installation)

You can install the `nijwel/image-upload` package via Composer. Run the following command in your project directory:

```
composer require nijwel/image-upload
```

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

[](#configuration)

No configuration is required to start using the package. However, you can customize paths and image dimensions as needed.

Usage
=====

[](#usage)

Basic Example
-------------

[](#basic-example)

Here’s a simple example of how to use the package to upload and resize an image:

For v1.0.0
----------

[](#for-v100)

```
use Nijwel\ImageUpload\ImageUpload;

$image = $request->input('image'); // Input image.
$newImageName = 'my_image'; // IF you want to rename image (Also you can send null value) .
$width = 200; // Desired width, (if you want to original image width pass value 0 or null).
$height = null; // Desired height (null means maintain aspect ratio , You can handle manually)
$path = 'backend/assets/images/'; // Directory to save the image

// Just call in your method

// Upload an image
imageUpload($image, $width, $height, $path ,$newImageName );

// Upload a file
$filePath = fileUpload($file, 'custom/path', 'newFileName');
```

For v^1.0
---------

[](#for-v10)

```
// Just call in your method for version v^1.0
use ImageUpload;

// Upload an image
$imagePath = ImageUpload::imageUpload($file, 300, 300, 'custom/path', 'newImageName');

// Upload a file
$filePath = ImageUpload::fileUpload($file, 'custom/path', 'newFileName');
```

Methods v1.0.0
--------------

[](#methods-v100)

`imageUpload($file, $newImageName = null, $width = null, $height = null, $path = 'images/')`

Methods v^1.0
-------------

[](#methods-v10)

`ImageUpload::imageUpload($file, $newImageName = null, $width = null, $height = null, $path = 'images/')`

Uploads and resizes the image.

- file: Path to the original image file.
- newImageName: Name for the image (optional, a unique ID is used if not provided).
- width: Width for the resized image (optional).
- height: Height for the resized image (optional). If null or 0, the aspect ratio is maintained.
- path: Directory path to save the resized image (optional).

Error Handling
--------------

[](#error-handling)

Ensure that the provided image path is correct and that the directory has appropriate write permissions. The package will throw exceptions for unsupported image types or invalid paths.

Contributing
------------

[](#contributing)

If you'd like to contribute to the development of this package, please follow these steps:

1. Fork the repository.
2. Create a feature branch.
3. Commit your changes.
4. Push your branch and submit a pull request.

License
-------

[](#license)

This package is licensed under the MIT License. See the LICENSE file for more details.

Contact
-------

[](#contact)

For any issues or questions, please open an issue on the repository or contact

You can visit this repository :

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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

Total

2

Last Release

544d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db0a2af4dc84ef370e4eabbf851e559ea37b1be0d4805ff16fbfbdaa9eecb26?d=identicon)[Nijwel](/maintainers/Nijwel)

---

Top Contributors

[![nijwel](https://avatars.githubusercontent.com/u/58605617?v=4)](https://github.com/nijwel "nijwel (12 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nijwel-image-upload/health.svg)

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

###  Alternatives

[bagisto/bagisto

Bagisto Laravel E-Commerce

26.2k161.6k7](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.0k32.8k1](/packages/krayin-laravel-crm)[unopim/unopim

UnoPim Laravel PIM

9.4k1.8k](/packages/unopim-unopim)[blair2004/nexopos

The Free Modern Point Of Sale System build with Laravel, TailwindCSS and Vue.js.

1.2k2.3k](/packages/blair2004-nexopos)[spatie/mailcoach

Self-host Mailcoach

4007.0k](/packages/spatie-mailcoach)

PHPackages © 2026

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