PHPackages                             m2code/file-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. m2code/file-manager

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

m2code/file-manager
===================

Flexible Laravel File Manager: upload, move, delete, thumbnail, blurhash, and more

v1.0.4(9mo ago)078MITPHPPHP ^8.2

Since Jun 29Pushed 1mo agoCompare

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

READMEChangelog (4)Dependencies (7)Versions (7)Used By (0)

🛠️ File Manager for Laravel (WIP)
=================================

[](#️-file-manager-for-laravel-wip)

> ⚠️ **This package is currently under active development. Breaking changes may occur. Contributions are welcome!**

📦 A modular, clean-architecture-based Laravel package to manage file operations — image, video, documents — with support for multiple drivers (local, cloud, Firebase, etc), progressive images, and flexible configuration.

---

🔧 Features
----------

[](#-features)

- 📁 Save and delete files (single or batch)
- 🧠 Auto-detect file type &amp; handle accordingly
- 🧾 Input-agnostic file handling (`UploadedFile`, base64 data URI, raw SVG string)
- 🌁 Image processing (blurhash, low quality, watermark, optimized AVIF/WebP)
- 🧩 Structured variants (`original`, `optimized`, `low_quality`, `watermark`)
- ☁️ Extensible storage drivers: local, S3, Firebase, etc.
- ⚙️ Clean architecture (DDD-friendly &amp; testable)
- 🧩 Facade and fluent Uploader API
- 🔐 Support for signed/dynamic URLs

---

🚀 Installation
--------------

[](#-installation)

```
composer require m2code/file-manager
```

🛠 Publish Configuration
-----------------------

[](#-publish-configuration)

```
php artisan vendor:publish --tag=config --provider="M2code\FileManager\FileManagerServiceProvider"
```

📂 Basic Usage
-------------

[](#-basic-usage)

### Save file using facade (no config):

[](#save-file-using-facade-no-config)

```
use M2code\FileManager\Facades\FileManager;

$result = FileManager::save($request->file('image'), 'uploads');
$result->filePath;
```

### Save from base64 or raw SVG string:

[](#save-from-base64-or-raw-svg-string)

```
use M2code\FileManager\Facades\FileManager;

// Base64 PNG
$base64Png = 'data:image/png;base64,...';
$png = FileManager::save($base64Png, 'uploads');

// Base64 SVG
$base64Svg = 'data:image/svg+xml;base64,...';
$svgFromBase64 = FileManager::save($base64Svg, 'uploads');

// Raw SVG string
$svg = '...';
$svgRaw = FileManager::save($svg, 'uploads');
```

### Upload image with processing:

[](#upload-image-with-processing)

```
use M2code\FileManager\Application\Uploader\ImageUploader;

$result = ImageUploader::make()
    ->blur()
    ->lowQuality()
    ->watermark()
    ->optimize('avif') // fallback to webp, or skipped if unsupported
    ->upload($request->file('photo'), 'uploads/images');

$result->variants->get('original')?->path;
$result->variants->get('optimized')?->path;
$result->variants->get('low_quality')?->path;
$result->variants->get('watermark')?->path;
$result->blurhash;

// Backward-compatible fields (still available):
$result->path;
$result->optimizedPath;
$result->lowQualityPath;
$result->watermarkPath;
```

### SVG behavior in ImageUploader

[](#svg-behavior-in-imageuploader)

```
$svg = '...';

$result = ImageUploader::make()
    ->blur()
    ->lowQuality()
    ->watermark()
    ->optimize('avif')
    ->upload($svg, 'uploads/images');

// SVG only keeps original variant, raster processing is skipped:
$result->variants->get('original')?->path;   // not null
$result->variants->get('low_quality');       // null
$result->variants->get('optimized');         // null
$result->blurhash;                           // null
```

### Delete files:

[](#delete-files)

```
use M2code\FileManager\Facades\FileManager;

FileManager::delete('uploads/images/file.jpg');

FileManager::deleteMany([
    'uploads/images/a.jpg',
    'uploads/images/b.jpg',
]);

// Delete all variants from upload result:
FileManager::deleteVariants($result->variants);
```

📡 Get file URL
--------------

[](#-get-file-url)

```
use M2code\FileManager\Facades\FileUrl;

$url = FileUrl::getUrl('uploads/images/image.jpg'); // Local or driver-specific
$signed = FileUrl::getSignedUrl('uploads/images/image.jpg', now()->addMinutes(5));
```

🗃 Supported Drivers
-------------------

[](#-supported-drivers)

- ✅ Local (default)
- 🔜 S3, Firebase, Custom drivers

Configure in `config/file-manager.php`:

```
'default_driver' => 'local',
'default_deleter' => 'local',
'default_url_generator' => 'local',
```

🧩 Requirement: Imagick
----------------------

[](#-requirement-imagick)

This package uses `intervention/image` with Imagick driver for image processing features such as:

- Blurhash generation
- Optimized AVIF/WebP variant generation
- Low quality image variants
- Watermark (when enabled)

Imagick is required and declared in `composer.json` (`ext-imagick`).

---

⚙️ Why Imagick?
---------------

[](#️-why-imagick)

Compared to GD:

- Better image quality
- Faster processing for large images
- More advanced image manipulation capabilities

If you're serious about handling images, GD is… let's say, “minimum effort mode”.

---

💻 Installation Guide
--------------------

[](#-installation-guide)

### 🪟 Windows

[](#-windows)

1. Download Imagick DLL from: 👉
2. Choose version that matches:

    - Your PHP version
    - Thread safety (TS/NTS)
    - Architecture (x64/x86)
3. Copy `.dll` file to: `ext/`
4. Enable in `php.ini`:

```
extension=imagick
```

5. Restart your web server

### 🍎 macOS

[](#-macos)

Using Homebrew:

```
brew install imagemagick
pecl install imagick
```

Then enable in php.ini:

```
extension=imagick
```

### 🐧 Linux (Ubuntu/Debian)

[](#-linux-ubuntudebian)

```
sudo apt update
sudo apt install imagemagick
sudo apt install php-imagick
```

Restart PHP / Web Server:

```
sudo service php-fpm restart
# or
sudo service apache2 restart
```

### 🐧 Linux (CentOS/RHEL)

[](#-linux-centosrhel)

```
sudo yum install epel-release
sudo yum install ImageMagick ImageMagick-devel
sudo pecl install imagick
```

Enable in php.ini:

```
extension=imagick
```

✅ Verify Installation
---------------------

[](#-verify-installation)

Run:

```
php -m | grep imagick
```

If installed correctly, you should see:

```
imagick
```

✅ Current Stable Flow
---------------------

[](#-current-stable-flow)

- Upload image (with optional variants)
- Upload from `UploadedFile`, base64 data URI, or raw SVG string
- Read variant paths from `ImageUploadResult::variants`
- Generate URL / signed URL
- Delete single file / batch / all variants safely

📄 License
---------

[](#-license)

[MIT License](LICENSE) © Marij Mokoginta (M2code)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance77

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~12 days

Total

5

Last Release

277d ago

### Community

Maintainers

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

---

Top Contributors

[![marijmokoginta](https://avatars.githubusercontent.com/u/73541847?v=4)](https://github.com/marijmokoginta "marijmokoginta (32 commits)")

### Embed Badge

![Health badge](/badges/m2code-file-manager/health.svg)

```
[![Health](https://phpackages.com/badges/m2code-file-manager/health.svg)](https://phpackages.com/packages/m2code-file-manager)
```

###  Alternatives

[unisharp/laravel-filemanager

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

2.2k3.3M74](/packages/unisharp-laravel-filemanager)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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