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

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

devfactory/media
================

Laravel package for saving uploaded files and linking them with models

4.0.7(1y ago)2012.4k↓50%5[1 issues](https://github.com/DevFactoryCH/media/issues)[1 PRs](https://github.com/DevFactoryCH/media/pulls)MITPHPPHP &gt;=7.2

Since Nov 24Pushed 10mo ago6 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (35)Used By (0)

\#Media

This package saves uploaded files and links them with models

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

[](#installation)

### Laravel 5

[](#laravel-5)

> *NOTE*: If upgrading from 2.0.0, run `php artisan vendor:publish` and `php artisan migrate`

Using Composer, edit your `composer.json` file to require `devfactory/media`.

```
"require": {
  "devfactory/media": "2.0.*"
}

```

Then from the terminal run

```
composer update

```

Then in your `app/config/app.php` file register the service providers:

```
'Devfactory\Media\MediaServiceProvider',
'That0n3guy\Transliteration\TransliterationServiceProvider',
```

From within the laravel folder of your project, run:

```
php artisan vendor:publish

```

Followed by:

```
php artisan migrate

```

### Laravel 4

[](#laravel-4)

Using Composer, edit your `composer.json` file to require `devfactory/media`.

```
"require": {
  "devfactory/media": "1.0.*"
}

```

Then from the terminal run

```
composer update

```

Then in your `app/config/app.php` file register the service providers:

```
'Devfactory\Media\MediaServiceProvider',
'That0n3guy\Transliteration\TransliterationServiceProvider',
```

Run the migration to create the DB table:

```
php artisan migrate --package=devfactory/media

```

Finally, publish the config to make changes to where and how the files are stored:

```
php artisan config:publish devfactory/media

```

Usage
-----

[](#usage)

To use the package, you need to add the following to any of your models which will be receiving media uploads.

```
