PHPackages                             monstrex/media-storage - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. monstrex/media-storage

ActiveLibrary[File &amp; Storage](/categories/file-storage)

monstrex/media-storage
======================

Laravel Media Storage

0.14(5y ago)017MITPHP

Since Jan 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/MonstreX/media-storage)[ Packagist](https://packagist.org/packages/monstrex/media-storage)[ RSS](/packages/monstrex-media-storage/feed)WikiDiscussions main Synced 3w ago

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

Laravel Media Storage
=====================

[](#laravel-media-storage)

This laravel package allow you to manage different media files in your project. The package was inspired by Spatie Medialibrary package. But this package also can handle files without binding to certain model's records. So you can use Spatie Medialibary way to store files or you can use independed media collection don't belong any models at all. Also the package can manipulate some image conversions.

Requirements
------------

[](#requirements)

> Laravel 8.\*

Installing
----------

[](#installing)

> composer require monstrex/media-storage

Publish config:

```
$ php artisan vendor:publish --provider="MonstreX\MediaStorage\MediaStorageServiceProvider" --tag="config"
```

> You may use your own way to generate target file names using custom generator in config file:
> 'url\_generator' =&gt; MonstreX\\MediaStorage\\Services\\URLGeneratorService::class,

Make migrations:

```
$ php artisan vendor:publish --provider="MonstreX\MediaStorage\MediaStorageServiceProvider" --tag="migrations"
$ php artisan migrate
```

Adding
------

[](#adding)

```
$user1 = User::find(1);
// Add file from request and bind the file to model using collection name (string)
$collection = Media::add(request()->file('myfile'))->model($user1)->collection('new-gallery')->create();
// Add file from path and disk
$collection = Media::add('images/1.jpg', 'local')->collection('local-file')->create();
// Add file using Collection ID (int)
$collection = Media::model($model)->add($files)->collection(5403)->create();
// Add file with custom properties
$collection = Media::add($file)->props(['title' => 'Novus news','alt' => 'Image #2'])->collection('images')->create();
// Add files using noname collection. You can get collection ID from returned collection - collection_id field.
$collection = Media::add($files)->create();
// Will save original source file as is
$collection = Media::add('images/1.jpg', 'local')->preserveOriginal()->create();
// Will replace target file if exist.
$collection = Media::add($file)->replaceFile()->create();
// Will replace target file name using language table from config file
$collection = Media::add($file)->transliterate('ru')->collection('cyrillic-gallery')->create();
```

Retrieving
----------

[](#retrieving)

```
// Get path by record ID
$path = Media::find(1)->path();
// Get path by MEDIA ID
$path = Media::id(3)->path();
// Get relative URL
$url = Media::id(3)->url();
// Get full URL
$url = Media::id(3)->fullUrl();
// Generate conversion if not exist and return URL
$url = Media::id(3)->crop(250,300)->url();
// Get collection by collection ID
$collection = Media::collection(5403)->get();
// Get collection by collection Name
$collection = Media::model($user1)->collection('new-gallery')->get();
// Get All media entries
$collection = Media::all();
// Get all properties
Media::id(3)->props();
// Get certain propery
Media::id(3)->prop('title');
Media::id(3)->prop('setting.width');
```

Modify
------

[](#modify)

```
// Set properties
Media::id(3)->props(['title' => 'New title'])->save();
// Set one property
Media::id(3)->prop('settings.width', 500)->save();
// Set order
$collection = Media::collection('new-gallery')->get();
$collection[0]->order(1);
$collection[1]->order(2);
$collection[2]->order(3);
Media::save($collection);
```

Removing
--------

[](#removing)

```
// Delete one media entry
Media::id(3)->delete();
// Delete whole collection
Media::collection(5403)->delete();
// Delete collection binded to model
Media::model($user1)->collection('new-gallery')->delete()
// Delete All media entries
Media::deleteAll();
```

Testing
-------

[](#testing)

All tests provided.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

1998d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1912698?v=4)[Yuriy Ovdeyev](/maintainers/MonstreX)[@MonstreX](https://github.com/MonstreX)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.5M85](/packages/unisharp-laravel-filemanager)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[barryvdh/elfinder-flysystem-driver

A Flysystem Driver for elFinder

1865.1M40](/packages/barryvdh-elfinder-flysystem-driver)[october/rain

October Rain Library

1601.7M83](/packages/october-rain)[code16/sharp

Laravel Content Management Framework

79164.7k8](/packages/code16-sharp)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19346.6k3](/packages/symfony-ux-cropperjs)

PHPackages © 2026

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