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

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

mar3y/image-upload
==================

A package for handling image uploads in Laravel applications.

v1.0.0(11mo ago)041MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3

Since Jun 8Pushed 11mo agoCompare

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

READMEChangelogDependencies (5)Versions (2)Used By (0)

Image Upload Package
====================

[](#image-upload-package)

A Laravel package for handling image uploads in your applications.

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

[](#installation)

You can install the package via composer:

```
composer require mar3y/image-upload
```

Usage
-----

[](#usage)

### Using the HasImage Trait

[](#using-the-hasimage-trait)

To use the `HasImage` trait in your model, follow these steps:

1. **Add the trait to your model class:**

    ```
    use mar3y\ImageUpload\Traits\HasImage;

    class YourModel extends Model
    {
        use HasImage;

        protected static $imageAttributes = ['image'];
    }
    ```
2. **Define the image attributes:**

    In your model class, define the `$imageAttributes` property as an array of attribute names that will store image paths. For example, if your model has an `image` attribute, you would set `protected static $imageAttributes = ['image'];`.
3. **Upload an image:**

    When you save a model instance with an image attribute set to an `UploadedFile` instance, the trait will automatically upload the image and store the path in the attribute.

    ```
    $model = new YourModel();
    $model->image = $request->file('image');
    $model->save();
    ```
4. **Retrieve the image URL:**

    You can retrieve the full URL of the image using the attribute name.

    ```
    $imageUrl = $model->image;
    ```

### Using the ImageUploadHelper

[](#using-the-imageuploadhelper)

You can also use the `ImageUploadHelper` class directly:

```
use mar3y\ImageUpload\Helpers\ImageUploadHelper;

$path = ImageUploadHelper::uploadImage($file, 'your-directory');
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance51

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

Unknown

Total

1

Last Release

345d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[orchestra/canvas

Code Generators for Laravel Applications and Packages

20917.2M158](/packages/orchestra-canvas)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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