PHPackages                             frengky/yupload - 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. [Database &amp; ORM](/categories/database)
4. /
5. frengky/yupload

ActiveLibrary[Database &amp; ORM](/categories/database)

frengky/yupload
===============

Laravel package for easy file uploads maintenance

v2.0.0(6y ago)030MITPHPPHP &gt;=7.2CI failing

Since Aug 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/frengky/laravel-yupload)[ Packagist](https://packagist.org/packages/frengky/yupload)[ Docs](https://github.com/frengky/laravel-yupload)[ RSS](/packages/frengky-yupload/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (6)Versions (7)Used By (0)

Laravel Yupload
===============

[](#laravel-yupload)

Laravel package for easy file uploads maintenance. It helps to maintain file upload on each of your model.

What this packages do?

- Manages file uploads related to a model
- Uploaded file are stored using `Storage`, no need path config, respecting your `config/filesystem.php`
- Create extra database tables/fields is not required, thanks to dynamic `upload_*` mutator and accessor.
- Store multiple files via `uploads` mutator and accessor
- Any uploaded files are automatically maintained, its deleted and replaced on updates.

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

[](#installation)

Install the package via `Composer`

```
composer require frengky/yupload

```

Then publish the configuration files to your `app/config`

```
php artisan vendor:publish --tag=config

```

Finally, run migrations to create the `uploads` table

```
php artisan migrate

```

Applying on your model
----------------------

[](#applying-on-your-model)

For each of your model that have file uploads, use the `HasUploads` traits

```
use Frengky\Yupload\Concerns\HasUploads;

class User extends Authenticatable
{
    use HasUploads;
    // store uploaded files under 'user/' path
}

class Product extends Model
{
    use HasUploads;
    // store upload under 'product/' path
}
```

> The physical file will be stored using `Storage` to your desired disk. It will using your model name (in lowercase) as path.

Storing uploaded file
---------------------

[](#storing-uploaded-file)

Saving uploaded file via `uploads` and `upload_*` mutators

```
$user = User::find(1);

// Store uploaded file via dynamic mutator
$user->upload_photo = $request->file('photo');
$user->upload_screenshot = $request->file('screenshot');
$user->uploads = $request->file('all_documents');

// via create
$newUser = User::create([
    'name' => 'Foo',
    'email' => 'foo@example.com',
    'upload_photo' => $request->file('photo')
]);

// store or update via fill
$user->fill([
    'upload_photo' => $request->file('photo')
]);

// store via relationship
$user->uploads()->save(
    Upload::make($request->file('photo'))
);

// Store multiple files via predefined 'uploads' mutators
$user->uploads = $request->files;
$user->uploads = $request->file('anotherfile1');
$user->uploads = $request->file('anotherfile2');

// Finally call save() your model as usual to save the related uploaded files
$user->save();
```

> All `upload_*` prefixed attributes are virtual mutator, creating database fields for each upload type is not needed. The `uploads` attribute are predefined mutator to store multiple files.

Accessing uploaded file
-----------------------

[](#accessing-uploaded-file)

Acessing uploaded file via `uploads` and `upload_*` accessor

```
$product = Product::find(1);

// via accessor
$photo = $product->upload_photo;

// via relationship
$photo = $product->uploads()->ofType('photo');

// All uploaded file for this entity
$allFiles = $product->uploads;
```

Update/replace uploaded file
----------------------------

[](#updatereplace-uploaded-file)

```
$product = Product::find(1);

// via accessor
$product->upload_photo = $request->file('photo');
$product->save();

// via 'Upload' model
$photo = $product->uploads()->ofType('photo');
$photo->file = $request->file('photo');
$photo->save();
```

> The previous physical file will be automatically deleted on save()

Deleting uploaded file
----------------------

[](#deleting-uploaded-file)

```
// Delete single uploaded file
$photo = $user->upload_photo;
$photo->delete();

// Delete all uploaded file related to this entity
$user->deleteUploads();

// Deleting the entity also delete all related uploaded file
$user->delete();
```

> If your model use **SoftDeletes**, then the uploaded file will be preserved, only deleted on forceDelete();

That's all for now.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Recently: every ~125 days

Total

6

Last Release

2312d ago

Major Versions

v1.1.2 → v2.0.02020-01-14

PHP version history (2 changes)v1.0.0PHP &gt;=5.5.9

v2.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4408112?v=4)[Frengky](/maintainers/frengky)[@frengky](https://github.com/frengky)

---

Top Contributors

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

---

Tags

laraveldatabasemodelupload

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frengky-yupload/health.svg)

```
[![Health](https://phpackages.com/badges/frengky-yupload/health.svg)](https://phpackages.com/packages/frengky-yupload)
```

###  Alternatives

[waad/laravel-model-metadata

A robust Laravel package for handling metadata with JSON casting, custom relation names, and advanced querying capabilities.

823.1k](/packages/waad-laravel-model-metadata)[designmynight/laravel-elasticsearch

Use Elasticsearch as a database in Laravel to retrieve Eloquent models and perform aggregations.

3038.6k](/packages/designmynight-laravel-elasticsearch)[nevadskiy/laravel-translatable

Add translations to your Eloquent models

2120.4k1](/packages/nevadskiy-laravel-translatable)

PHPackages © 2026

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