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

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

moirei/media-library
====================

Manage media library with a directory system and associate files with Eloquent models.

0.2.0(1y ago)0505MITPHPPHP ^7.2|^8.0

Since May 19Pushed 1mo agoCompare

[ Source](https://github.com/moirei/media-library)[ Packagist](https://packagist.org/packages/moirei/media-library)[ Docs](https://moirei.github.io/media-library)[ RSS](/packages/moirei-media-library/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

Laravel Media Library
=====================

[](#laravel-media-library)

Laravel application media content management made easy.

Documentation
-------------

[](#documentation)

All documentation is available at [the documentation site](https://moirei.github.io/media-library).

💚 Features
----------

[](#green_heart-features)

- **Image URL manipulation**: manipulate uploaded images with Cloud Image compatible API for your responsive frontend
- **Eloquent models**: associate files with Eloquent models. Attach different file types (video, images) to different model attributes with polymorphic many-to-many while having the ability to fully configure model-specific uploads.
- **Secure**: public, signed, and protected endpoints and file sharing and downloads regardless of storage disk. Includes configurable middleware per API endpoints for fine-grained permissions and authorization
- **File sharing**: securely share files a directories with anyone. Including none registered users.
- **Uploads**: upload by external URL, local path, File or request UploadFile. The package exposes internal API endpoints for uploads, downloads, streams and other admin operations
- **Control**: control uploads and shared files by types, size, size per type
- **Responsive images**: automatically resize images on uploads for responsive frontend
- **Storage system**: provides media storage namespacing for multi-tenant and multi-domain uploads with varying configurations.
- **Rich text attachments**: seamlessly management attachments and integrate model text fields

```
...
use MOIREI\MediaLibrary\Casts\AsMediaItem;
use MOIREI\MediaLibrary\Casts\AsMediaItems;
use MOIREI\MediaLibrary\Traits\InteractsWithMedia;

class Product extends Model
{
   use InteractsWithMedia;

   $casts = [
      'image' => AsMediaItem::class,
      'gallery' => AsMediaItems::class,
   ];
   ...
}
...

$video = File::find('video-file-id');

$product = Product::create([
   'name' => 'MOIREI MP202+',
   'image' => 'image-file-id1',
   'gallery' => ['image-file-id2', $video],
]);
```

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

[](#installation)

```
composer require moirei/media-library
```

### Publish the config

[](#publish-the-config)

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

### Prepare the database

[](#prepare-the-database)

```
php artisan vendor:publish --tag=media-library-migrations
```

Then run the migrations

```
php artisan migrate
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](./CHANGELOG.md).

Credits
-------

[](#credits)

- This package was inspired by [classic-o/nova-media-library](https://github.com/classic-o/nova-media-library), an excellent package for [Laravel Nova](https://nova.laravel.com/)
- [Augustus Okoye](https://github.com/augustusnaz)

License
-------

[](#license)

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

###  Health Score

36

—

LowBetter than 81% of packages

Maintenance75

Regular maintenance activity

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Total

3

Last Release

411d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ac6a15a7b2f9055a98e4419e0d2820f72db3567706837ec388baee535d3e3e7?d=identicon)[moirei](/maintainers/moirei)

---

Top Contributors

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

---

Tags

laravelcloudlibraryfilesimagesmediacmsdownloadsvideosmoireiaudios

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)[okipa/laravel-medialibrary-ext

Extra features for spatie/laravel-medialibrary package.

1011.2k](/packages/okipa-laravel-medialibrary-ext)

PHPackages © 2026

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