PHPackages                             sudippalash/mediauploader - 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. sudippalash/mediauploader

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

sudippalash/mediauploader
=========================

Laravel package for Media Uploader

2.0.5(1y ago)51.0k↓100%2MITPHPPHP ^7.3|^8.0

Since Dec 8Pushed 1y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (2)Versions (21)Used By (0)

Media Uploader
--------------

[](#media-uploader)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a97a42326426c50defc5bde3624ddf3a5735d294e781a05f7c9d52744bdcccc0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f737564697070616c6173682f6d6564696175706c6f616465723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sudippalash/mediauploader)[![Total Downloads](https://camo.githubusercontent.com/19a38c41a7400a2703cbf3887758ebfd2d753f92d1a6537ff231b7a3aee87c3b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f737564697070616c6173682f6d6564696175706c6f616465723f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sudippalash/mediauploader)

`mediauploader` is a simple file-handling package for `Laravel` that provides various options for managing files, including image uploads, file uploads, WebP uploads, base64 image uploads, image uploads from URLs, and Google image content uploads. The package currently supports `public`, `local`, and `s3` storage (note: only publicly accessible `S3` buckets are supported).

It also includes file and image preview functionality.

Install
-------

[](#install)

Via Composer

```
composer require sudippalash/mediauploader
```

#### Publish config file

[](#publish-config-file)

You should publish the config file with:

```
php artisan vendor:publish --provider="Sudip\MediaUploader\Providers\AppServiceProvider" --tag=config

```

In `config/mediauploader.php` config file you should set `mediauploader` global path.

```
return [
    /*
    |--------------------------------------------------------------------------
    | Base Directory
    |--------------------------------------------------------------------------
    |
    | base_dir stores all other directory inside storage folder of your laravel application by default
    | if you specify any name. all storage will be done inside that directory or name that you specified
    |
    */

    'base_dir' => null,

    /*
    |--------------------------------------------------------------------------
    | Thumb Directory
    |--------------------------------------------------------------------------
    |
    | thumb_dir creates another folder inside the directory as a "thumb" by default
    | you can change the name thumb to any other name you like.
    */

    'thumb_dir' => 'thumb',

    /*
    |--------------------------------------------------------------------------
    | Timestamp Prefix
    |--------------------------------------------------------------------------
    |
    | If timestamp_prefix is true then create a file with a timestamp to ignore the same name image replacement. Example: image-1658562981.png.
    | If timestamp_prefix is false then the script checks file exists or not if the file exists then add the time() prefix for the new file otherwise leave it as the file
    | name.
    */

    'timestamp_prefix' => false,

    /*
    |--------------------------------------------------------------------------
    | Thumb Image Height Width
    |--------------------------------------------------------------------------
    |
    | specify the thumb image ratio of height and weight by default it takes 300px X 300px
    */

    'image_thumb_height' => 300,
    'image_thumb_width' => 300,

    /*
    |--------------------------------------------------------------------------
    | Fake Image Url
    |--------------------------------------------------------------------------
    |
    | fake_image_url , if you specify a fake image path or url here. the entire package will use
    | this image when there is no image found. or you can specify the fake image in the
    | function parameter as well.
    | Example: 'fake_image_url' => 'images/fake.png' or 'fake_image_url' => 'https://example.com/images/fake.png,
    */

    'fake_image_url' => null,

    /*
    |--------------------------------------------------------------------------
    | Folder permission
    |--------------------------------------------------------------------------
    |
    | path_permission , if you create a folder in your project then you can define your folder permission.
    | Example: null, 0755, 0777
    */

    'path_permission' => 0777,
];
```

Configuration
-------------

[](#configuration)

Before using this, you must complete the following steps (if you want to use the default filesystem disk, which is public):

1. Change your env filesystem drive to this if you want to use public storage directory.

```
FILESYSTEM_DISK=public

```

2. Please make sure to link your storage before using this package

```
php artisan storage:link
```

3. You can also specify the filesystem disk when using image or file functions (see the usage section for details).

```
MediaUploader::disk('local')->usageFunction();
```

Usage (File Upload)
-------------------

[](#usage-file-upload)

1. Image Upload

```
MediaUploader::imageUpload(, , thumb=false, name=null, $imageResize = [], $thumbResize = [0, 0]);
```

Example:

```
$file = MediaUploader::imageUpload($request->file, 'images', 1, null, [600, 600]);

if ($file) {
    // File is saved successfully
}
```

2. Webp Image Upload

```
MediaUploader::webpUpload(, , thumb=false, name=null, $imageResize = [], $thumbResize = [0, 0]);
```

Example:

```
$file = MediaUploader::webpUpload($request->file, 'webps', 1, null, [600, 600]);

if ($file) {
    // File is saved successfully
}
```

3. Any Upload (if you are not sure what type of file is, you can use this)

```
MediaUploader::anyUpload(, , name=null);
```

Example:

```
$file = MediaUploader::anyUpload($request->file, 'files', 'filename');

if ($file) {
    // File is saved successfully
}
```

4. Image Upload from URL

```
MediaUploader::imageUploadFromUrl(, , thumb=false, name=null, $imageResize = [], $thumbResize = [0, 0]);
```

Example:

```
$file = MediaUploader::imageUploadFromUrl($url, 'images', 1, null, [600, 600]);

if ($file) {
    // File is saved successfully
}
```

5. Base64 image Upload

```
MediaUploader::base64ImageUpload(, , thumb=false, name=null, $imageResize = [], $thumbResize = [0, 0]);
```

Example:

```
$file = MediaUploader::base64ImageUpload($content, 'images', 1, null, [600, 600]);

if ($file) {
    // File is saved successfully
}
```

6. Content Upload

```
MediaUploader::contentUpload(, , name=null);
```

Example:

```
$file = MediaUploader::contentUpload($content, 'contents', 'name');

if ($file) {
    // File is saved successfully
}
```

7. Thumb (to create a thumb from an existing image, you can use this)

```
MediaUploader::thumb(, , $thumbPath = false, $thumbWidth = 0, $thumbHeight = 0);
```

Example:

```
$file = MediaUploader::thumb('thumbs', $file, 200, 200);

if ($file) {
    // File is saved successfully
}
```

Returns:

Response from every function looks like this

```
[
    "name" => "example-image.jpg"
    "originalName" => "example-image.jpg"
    "size" => 148892
    "width" => 600
    "height" => 600
    "mime_type" => "image/jpeg"
    "ext" => "jpg"
    "url" => "http://localhost/storage/test/example-image.jpg"
]
```

Usage (File Delete)
-------------------

[](#usage-file-delete)

File Delete

```
MediaUploader::delete(, , $thumb = false)
```

Example:

```
$file = MediaUploader::delete('images', $file_name, true);

if ($file) {
    // File is deleted successfully
}
```

Usage (Directory Delete)
------------------------

[](#usage-directory-delete)

Directory Delete

```
MediaUploader::removeDirectory()
```

Example:

```
$path = MediaUploader::removeDirectory('images');

if ($path) {
    // Directory is deleted successfully
}
```

Usage (FIle or Image Exists check)
----------------------------------

[](#usage-file-or-image-exists-check)

1. FIle/Image Exists

```
MediaUploader::fileExists(, )
```

Example:

```
if(MediaUploader::fileExists('images', $file_name)) {
    //
}
```

Usage (FIle or Image URL &amp; Preview)
---------------------------------------

[](#usage-file-or-image-url--preview)

1. FIle or Image Url

```
MediaUploader::showUrl(, )
```

Example:

```
{!! MediaUploader::showUrl('images', $file_name) !!}
```

2. File Preview

```
MediaUploader::showFile(, , )
```

Example:

```
{!! MediaUploader::showFile('images', $file_name, $empty_text) !!}
```

3. File Preview from url

```
MediaUploader::showFileFromUrl(, , )
```

Example:

```
{!! MediaUploader::showFileFromUrl($file_url, $file_name, $empty_text) !!}
```

4. Image Preview

```
MediaUploader::showImg(, , )
```

Example:

```
{!! MediaUploader::showImg($pathOrUrl, $file_name, [
    'thumb' => true, // If thumb image store via upload function.
    'popup' => true, // Currently support only jQuery fancybox.
    'fakeImg' => 'images/avatar.png', // Pass fake image path without url or pass true (if pass true it will generate fake image from config file fake_image_url value).
    'id' => 'image',
    'class' => 'img-fluid',
    'style' => '',
    'alt' => 'Nice Image',
]) !!}
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance46

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% 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 ~66 days

Recently: every ~32 days

Total

19

Last Release

411d ago

Major Versions

1.1.2 → 2.0.02024-11-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/5e4dad3b25d885d7ee33085d1a82851871161020923a26ac2b2276e5950c201a?d=identicon)[sudippalash](/maintainers/sudippalash)

---

Top Contributors

[![sudippalash](https://avatars.githubusercontent.com/u/16589727?v=4)](https://github.com/sudippalash "sudippalash (41 commits)")[![ferdousanam](https://avatars.githubusercontent.com/u/40851904?v=4)](https://github.com/ferdousanam "ferdousanam (3 commits)")

---

Tags

laravellaravel-media-uploaderSudipmedia-uploader

### Embed Badge

![Health badge](/badges/sudippalash-mediauploader/health.svg)

```
[![Health](https://phpackages.com/badges/sudippalash-mediauploader/health.svg)](https://phpackages.com/packages/sudippalash-mediauploader)
```

###  Alternatives

[unisharp/laravel-filemanager

A file upload/editor intended for use with Laravel 5 to 10 and CKEditor / TinyMCE

2.2k3.3M73](/packages/unisharp-laravel-filemanager)[reshadman/file-secretary

Get rid of anything related to files in Laravel, This package handles all for you. Anything we mean.

1131.8k](/packages/reshadman-file-secretary)

PHPackages © 2026

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