PHPackages                             runthis/laravel-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. [Image &amp; Media](/categories/media)
4. /
5. runthis/laravel-media

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

runthis/laravel-media
=====================

Handle media in laravel packages

1.0.0(3y ago)011[3 PRs](https://github.com/runthis/laravel-media/pulls)MITPHPPHP ^8.0CI passing

Since Jun 28Pushed 3mo ago1 watchersCompare

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

READMEChangelog (1)Dependencies (9)Versions (5)Used By (0)

Laravel Media
=============

[](#laravel-media)

A tiny laravel package to conveniently handle single file media uploads with little configuration.

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

[](#installation)

```
composer require runthis/laravel-media

```

Usage
-----

[](#usage)

Add to the file you want to process uploads in, such as a controller.

```
use Runthis\Media\Facades\Media;
use Runthis\Media\Requests\MediaRequest;

```

Include the `MediaRequest` class in the function parameter and execute the `create` method on the `Media` facade.

Example:

```
public function upload(MediaRequest $request) {
    $test = Media::create($request);
    dd($test);
}

```

Inside the `dd()` you can see the complete object details and process these as you see fit (such as keeping track of these uploads in a database if you like).

Within the object results is a `size` key. You can simply echo this out to get the bytes, or you can add `->pretty()` to get a prettier output. You can also pass a string parameter to the `pretty()` method.

Options:

```
l: lowercase suffix (12.45 mb instead of 12.45 MB)
s: spacing omitted (12.45MB instead of 12.45 MB)
b: Ending "B" removed (12.45 M instead of 12.45 MB)

```

Examples:

```
$test->size->pretty('sb'); // 12.45M
$test->size->pretty('ls'); // 12.45m
$test->size->pretty('l'); // 12.45 mb
$test->size->pretty('bl'); // 12.45 m

```

*The `Media::create` method expects a file with the key named file.*

Publish Config
--------------

[](#publish-config)

If you want, run the below command to add a media.php file to your config folder.

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

```

From the media config file you can change the storage disk name and the rules for the media (such as file types, size limit, etc).

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance54

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Unknown

Total

1

Last Release

1414d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11a8cb5aa101463ea8da7c821f10fa6e49e504935898e715bb1504c875a0f00a?d=identicon)[runthis](/maintainers/runthis)

---

Top Contributors

[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (36 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (34 commits)")[![runthis](https://avatars.githubusercontent.com/u/8216720?v=4)](https://github.com/runthis "runthis (5 commits)")

---

Tags

laravellaravel9medialaravelmedia

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[ralphjsmit/laravel-glide

Auto-magically generate responsive images from static image files.

4719.6k5](/packages/ralphjsmit-laravel-glide)[simplestats-io/laravel-client

Client for SimpleStats!

4515.5k](/packages/simplestats-io-laravel-client)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[spatie/laravel-og-image

Generate OG images for your Laravel app

305.2k](/packages/spatie-laravel-og-image)

PHPackages © 2026

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