PHPackages                             k90mirzaei/media - 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. k90mirzaei/media

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

k90mirzaei/media
================

This is a media handler associate files with Eloquent models

v1.0.3(4y ago)545MITPHPPHP &gt;=7.4

Since Jan 12Pushed 4y ago1 watchersCompare

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

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

Associate files with Eloquent models
====================================

[](#associate-files-with-eloquent-models)

[![Latest Version](https://camo.githubusercontent.com/831369876ece9e640d8243822c35dbbbcf4c64bacb81b47545d06dc0fc440604/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6b39306d69727a6165692f6d656469612e7376673f7374796c653d666c61742d737175617265)](https://github.com/k90mirzaei/media/releases)[![GitHub Workflow Status](https://camo.githubusercontent.com/a59bf07b7fc7cc99efba2f602e454de83532cffdaeffcf34c3c7a8850cdd102f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b39306d69727a6165692f6d656469612f72756e2d74657374733f6c6162656c3d7465737473)](https://camo.githubusercontent.com/a59bf07b7fc7cc99efba2f602e454de83532cffdaeffcf34c3c7a8850cdd102f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6b39306d69727a6165692f6d656469612f72756e2d74657374733f6c6162656c3d7465737473)[![Total Downloads](https://camo.githubusercontent.com/c7bd54882eb64a2ca137fcc0ed66607fc2f24f5d9bc4f8d3d717e527362d652e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b39306d69727a6165692f6d656469612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/k90mirzaei/media)

This package can associate all sorts of files with Eloquent models. It provides a simple API to work with.

Here are a few short examples of what you can do:

```
$newsItem = News::find(1);
$newsItem->addMedia($pathToFile)->toMediaCollection('images');
```

It can handle your uploads directly:

```
$newsItem->addMedia($request->file('image'))->toMediaCollection('images');
```

Want to store some large files on another filesystem? No problem:

```
$newsItem->addMedia($smallFile)->toMediaCollection('downloads', 'local');
$newsItem->addMedia($bigFile)->toMediaCollection('downloads', 's3');
```

The storage of the files is handled by [Laravel's Filesystem](https://laravel.com/docs/filesystem), so you can use any filesystem you like. Additionally the package can create image manipulations on images, audios and videos.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Testing
-------

[](#testing)

You can run the tests with:

```
vendor/bin/phpunit
```

License
-------

[](#license)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

4

Last Release

1582d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

audioeloquentimageslaravelmediaphpuploadvideo

### Embed Badge

![Health badge](/badges/k90mirzaei-media/health.svg)

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

###  Alternatives

[plank/laravel-mediable

A package for easily uploading and attaching media files to models with Laravel

8271.5M11](/packages/plank-laravel-mediable)[qcod/laravel-imageup

Auto Image upload, resize and crop for Laravel eloquent model using Intervention image

775113.8k](/packages/qcod-laravel-imageup)[mostafaznv/larupload

Larupload is a ORM based file uploader for laravel to upload image, video, audio and other known files.

73403.7k3](/packages/mostafaznv-larupload)[kalnoy/cruddy

Backend interface for handling CRUD operations on your Laravel Eloquent models.

1635.0k2](/packages/kalnoy-cruddy)

PHPackages © 2026

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