PHPackages                             shrestharikesh/laravel-media-manager - 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. shrestharikesh/laravel-media-manager

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

shrestharikesh/laravel-media-manager
====================================

Easily Upload Media in laravel

40PHP

Since Jul 5Pushed 2y ago2 watchersCompare

[ Source](https://github.com/shrestharikesh/laravel-media-manager)[ Packagist](https://packagist.org/packages/shrestharikesh/laravel-media-manager)[ RSS](/packages/shrestharikesh-laravel-media-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Media Manager
---------------------

[](#laravel-media-manager)

Easily associate your Media with Eloquent Models

- [Installation](#Installation)
- [Usage](#Usage)

Getting Started
---------------

[](#getting-started)

Install the package

- `composer require shrestharikesh/laravel-media-manager`

Run the migration

- `php artisan migrate`

Usage
-----

[](#usage)

Use the trait given by the package into any model:

```
use Shrestharikesh\LaravelMediaManager\HasMedia;

class Post extends Model
{
    use HasMedia;
    // Rest of your code
}
```

Associate as many media as you want to the model:

```
$post = Post::create($data);
$post->addMedia($request->image);
```

Or just one to each tag of the model:

```
$post->addMedia($request->image)->deletePrevious();
```

Easily upload media to different tags:

```
$post->addMedia($request->featured_image)->withTag('featured');
$post->addMedia($request->thumbnail_image)->withTag('thumbnail')->withAltText('Featured Image');
```

Get all the associated media easily:

```
$post = Post::find(1);
$post->getMedia($request->featured_image); // Returns medias from all topics
$post->getMedia($request->featured_image, 'default'); // Medias uploaded without any tag
$post->getMedia($request->featured_image, 'featured');
```

Or just the one:

```
$post->getFirstMedia($request->featured_image);
$post->getFirstMedia($request->featured_image, 'featured');
```

Show the media easily to your blade files:

```

```

You are about to remove your model and want to remove all associated medias?

```
$post = Post::find(1);
$post->deleteMedia();
$post->delete();
```

Or just delete medias from specific topic:

```
$post = Post::find(1);
$post->deleteMedia('featured');
```

Maybe just the one you don't need anymore:

```
$post->deleteSpecificMedia(1); // Pass the media id
```

Oh no! you've found bugs? Feel free to [create an issue on GitHub](https://github.com/shrestharikesh/laravel-media-manager/issues), we'll fix it ASAP.

License
-------

[](#license)

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

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/shrestharikesh-laravel-media-manager/health.svg)

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

###  Alternatives

[knplabs/gaufrette

PHP library that provides a filesystem abstraction layer

2.5k39.8M123](/packages/knplabs-gaufrette)[google/cloud-storage

Cloud Storage Client for PHP

34390.8M125](/packages/google-cloud-storage)[illuminate/filesystem

The Illuminate Filesystem package.

15261.6M2.6k](/packages/illuminate-filesystem)[superbalist/flysystem-google-storage

Flysystem adapter for Google Cloud Storage

26320.6M30](/packages/superbalist-flysystem-google-storage)[creocoder/yii2-flysystem

The flysystem extension for the Yii framework

2931.7M62](/packages/creocoder-yii2-flysystem)[flowjs/flow-php-server

PHP library for handling chunk uploads. Works with flow.js html5 file uploads.

2451.6M15](/packages/flowjs-flow-php-server)

PHPackages © 2026

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