PHPackages                             ahmed-aliraqi/laravel-media-uploader - 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. ahmed-aliraqi/laravel-media-uploader

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

ahmed-aliraqi/laravel-media-uploader
====================================

This package used to upload files using laravel-media-library

v8.1.0(5mo ago)34024.3k↓50%41[2 issues](https://github.com/ahmed-aliraqi/laravel-media-uploader/issues)3MITPHPPHP ^7.4|^8.0CI failing

Since Jun 26Pushed 5mo ago4 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (42)Used By (3)

Laravel Media Uploader
======================

[](#laravel-media-uploader)

[![Build Status](https://github.com/ahmed-aliraqi/laravel-media-uploader/workflows/tests/badge.svg)](https://github.com/ahmed-aliraqi/laravel-media-uploader/actions) [![StyleCI](https://camo.githubusercontent.com/1d3c30e726c5b061ed97f0ba5f5d88487c34061fb0e6c333f9ef46e148a80953/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3237353034353531312f736869656c643f7374796c653d666c6174)](https://github.styleci.io/repos/275045511) [![Total Downloads](https://camo.githubusercontent.com/2a6ebe594673fbe3013202e66221df9a93cf18f87e03b2c4cd26d07d60c10c00/68747470733a2f2f706f7365722e707567782e6f72672f61686d65642d616c69726171692f6c61726176656c2d6d656469612d75706c6f616465722f642f746f74616c2e737667)](https://packagist.org/packages/ahmed-aliraqi/laravel-media-uploader) [![Latest Stable Version](https://camo.githubusercontent.com/7908b911417f3f2eadadebcedb319182ed45ff8a10e8b64fbf865f09a4dda016/68747470733a2f2f706f7365722e707567782e6f72672f61686d65642d616c69726171692f6c61726176656c2d6d656469612d75706c6f616465722f762f737461626c652e737667)](https://packagist.org/packages/ahmed-aliraqi/laravel-media-uploader) [![License](https://camo.githubusercontent.com/f97f30763b5fe1729d3ad5ffe80ce3a7200cfcd9652bba3ad2c396bb6567f227/68747470733a2f2f706f7365722e707567782e6f72672f61686d65642d616c69726171692f6c61726176656c2d6d656469612d75706c6f616465722f6c6963656e73652e737667)](https://packagist.org/packages/ahmed-aliraqi/laravel-media-uploader)

> This package used to upload files using laravel-media-library before saving model.

[![Uploader](https://github.com/ahmed-aliraqi/laravel-file-uploader/raw/master/screenshots/uploader-v2.gif?raw=true)](https://github.com/ahmed-aliraqi/laravel-file-uploader/blob/master/screenshots/uploader-v2.gif?raw=true)

> In this package all uploaded media will be processed.

- All videos will converted to `mp4`.
- All audios will converted to `mp3`.
- All images `width` &amp; `height` &amp; `ratio` will be saved as custom property.
- All videos &amp; audios `duration` will be saved as custom property.

#### Requirements

[](#requirements)

- PHP &gt;= 7.4
- You should be ensured that the [ffmpeg](https://ffmpeg.org) was installed on your server

#### Installation

[](#installation)

```
composer require ahmed-aliraqi/laravel-media-uploader
```

> The package will automatically register a service provider.

> You need to publish and run the migration:

```
php artisan vendor:publish --provider="AhmedAliraqi\LaravelMediaUploader\Providers\UploaderServiceProvider" --tag="migrations"

php artisan migrate
```

> Publish [laravel-media-library](https://github.com/spatie/laravel-medialibrary) migrations:

```
php artisan vendor:publish --provider="Spatie\MediaLibrary\MediaLibraryServiceProvider" --tag="migrations"
php artisan migrate
```

> If you want to customize `attachments` validation rules, you should publish the config file:

```
php artisan vendor:publish --provider="AhmedAliraqi\LaravelMediaUploader\Providers\UploaderServiceProvider" --tag="config"
```

> If you want to customize validation translations, you should publish the `lang` files:

```
php artisan vendor:publish --provider="AhmedAliraqi\LaravelMediaUploader\Providers\UploaderServiceProvider" --tag="uploader:translations"
```

> This is the default content of the config file:

```
