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

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

smarterp-dev/file-manager
=========================

A comprehensive file management package for Laravel with support for multiple storage backends

1.0.0(3mo ago)01↓90.9%MITPHPPHP &gt;=7.4

Since Mar 30Pushed 3mo agoCompare

[ Source](https://github.com/turbotechlabs/file-manager)[ Packagist](https://packagist.org/packages/smarterp-dev/file-manager)[ RSS](/packages/smarterp-dev-file-manager/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

TurboTech File Manager
======================

[](#turbotech-file-manager)

A comprehensive file management package for Laravel with support for multiple storage backends, remote API integration, and easy file operations.

Features
--------

[](#features)

- 🚀 Multiple storage backend support (Local, S3, FTP, SFTP)
- 📤 File upload/download capabilities
- 🗑️ File deletion operations
- 📋 File listing and directory operations
- 📊 File metadata retrieval
- 🔗 Remote API integration for centralized file management
- 🔐 Secure file handling
- 💾 Configurable upload limits and allowed file types
- ⚙️ Easy Laravel integration with Facade support

Requirements
------------

[](#requirements)

- PHP &gt;= 7.4
- Laravel 6.0, 7.0, 8.0, 9.0, or 10.0
- Guzzle HTTP Client

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

[](#installation)

Install the package via Composer:

```
composer require turbotech/file-manager
```

The package will be automatically discovered by Laravel.

### Publishing Configuration

[](#publishing-configuration)

Publish the configuration file:

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

This will create a `config/file-manager.php` file in your Laravel project.

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

[](#configuration)

Edit the `.env` file to configure the file manager:

```
FILE_MANAGER_DRIVER=local
FILE_MANAGER_URL=https://your-storage-api.com
FILE_MANAGER_API_KEY=your_api_key_here
FILE_MANAGER_TIMEOUT=30
FILE_MANAGER_VERIFY_SSL=true
FILE_MANAGER_MAX_SIZE=104857600
FILE_MANAGER_CHUNK_SIZE=5242880
```

Or configure in `config/file-manager.php`:

```
return [
    'driver' => 'local',
    'remote' => [
        'url' => env('FILE_MANAGER_URL'),
        'api_key' => env('FILE_MANAGER_API_KEY'),
        'timeout' => 30,
        'verify_ssl' => true,
    ],
    'upload' => [
        'max_size' => 104857600, // 100MB
        'allowed_extensions' => ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx'],
        'chunk_size' => 5242880, // 5MB
    ],
    'paths' => [
        'uploads' => 'uploads',
        'temporary' => 'temporary',
        'archives' => 'archives',
    ],
];
```

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use TurboTech\FileManager\Facades\FileManager;

// Upload a file
$result = FileManager::upload('/path/to/file.pdf', 'documents');
// Returns: ['success' => true, 'path' => 'file.pdf', 'url' => '...', 'size' => 1024]

// Download a file
$result = FileManager::download('documents/file.pdf', '/local/path/file.pdf');

// Delete a file
$result = FileManager::delete('documents/file.pdf');

// Check if file exists
$exists = FileManager::exists('documents/file.pdf');

// Get file URL
$url = FileManager::getUrl('documents/file.pdf');

// List files in directory
$files = FileManager::listFiles('documents');
$allFiles = FileManager::listFiles('documents', true); // Recursive

// Get file metadata
$metadata = FileManager::getMetadata('documents/file.pdf');
// Returns: ['path' => '...', 'size' => 1024, 'lastModified' => timestamp, 'mimeType' => '...']

// Upload to remote API
$result = FileManager::uploadToRemote('/path/to/file.pdf');
```

### Using Dependency Injection

[](#using-dependency-injection)

```
use TurboTech\FileManager\FileManager;

class DocumentController extends Controller
{
    public function store(Request $request, FileManager $fileManager)
    {
        $result = $fileManager->upload(
            $request->file('document')->getPathname(),
            'documents'
        );

        return response()->json($result);
    }
}
```

API Reference
-------------

[](#api-reference)

### upload($filePath, $destinationPath = '', $options = \[\])

[](#uploadfilepath-destinationpath---options--)

Upload a file to storage.

**Parameters:**

- `$filePath` (string): Path to the file to upload
- `$destinationPath` (string): Destination directory path
- `$options` (array): Additional storage options

**Returns:** Array with success status, path, URL, and size

### download($filePath, $savePath = null)

[](#downloadfilepath-savepath--null)

Download a file from storage.

**Parameters:**

- `$filePath` (string): Path to the file in storage
- `$savePath` (string|null): Local path to save the file

**Returns:** Array with success status, path, and size

### delete($filePath)

[](#deletefilepath)

Delete a file from storage.

**Parameters:**

- `$filePath` (string): Path to the file to delete

**Returns:** Array with success status and message

### exists($filePath)

[](#existsfilepath)

Check if a file exists.

**Parameters:**

- `$filePath` (string): Path to the file

**Returns:** Boolean

### getUrl($filePath)

[](#geturlfilepath)

Get the URL of a file.

**Parameters:**

- `$filePath` (string): Path to the file

**Returns:** File URL as string

### listFiles($directory = '', $recursive = false)

[](#listfilesdirectory---recursive--false)

List files in a directory.

**Parameters:**

- `$directory` (string): Directory path
- `$recursive` (bool): Whether to list recursively

**Returns:** Array of file paths

### getMetadata($filePath)

[](#getmetadatafilepath)

Get file metadata.

**Parameters:**

- `$filePath` (string): Path to the file

**Returns:** Array with path, size, lastModified, and mimeType

### uploadToRemote($filePath, $options = \[\])

[](#uploadtoremotefilepath-options--)

Upload a file to remote API server.

**Parameters:**

- `$filePath` (string): Path to the file to upload
- `$options` (array): Additional options including:
    - `endpoint` (string): API endpoint path (default: 'upload')

**Returns:** Array with success status and response data

**Headers Sent:**

- `x-api-key`: API key from configuration
- `Accept`: application/json

**Example:**

```
$result = FileManager::uploadToRemote('/path/to/file.pdf', [
    'endpoint' => 'api/upload'
]);
```

Storage Drivers
---------------

[](#storage-drivers)

The package supports the following storage drivers:

- **local** - Local filesystem
- **s3** - Amazon S3
- **ftp** - FTP Server
- **sftp** - SFTP Server

Configure the driver in `config/file-manager.php` or set `FILE_MANAGER_DRIVER` in your `.env` file.

Error Handling
--------------

[](#error-handling)

The package throws exceptions for common errors. Always wrap operations in try-catch blocks:

```
use TurboTech\FileManager\Facades\FileManager;

try {
    $result = FileManager::upload('/path/to/file.pdf');
} catch (Exception $e) {
    Log::error('File upload failed: ' . $e->getMessage());
}
```

Examples
--------

[](#examples)

### User Avatar Upload

[](#user-avatar-upload)

```
use TurboTech\FileManager\Facades\FileManager;

class UserController extends Controller
{
    public function updateAvatar(Request $request)
    {
        $request->validate([
            'avatar' => 'required|image|max:2048',
        ]);

        $user = auth()->user();

        // Delete old avatar if exists
        if ($user->avatar_path && FileManager::exists($user->avatar_path)) {
            FileManager::delete($user->avatar_path);
        }

        // Upload new avatar
        $result = FileManager::upload(
            $request->file('avatar')->getPathname(),
            "users/{$user->id}/avatar"
        );

        $user->update(['avatar_path' => $result['path']]);

        return response()->json(['success' => true, 'url' => $result['url']]);
    }
}
```

### Document Management

[](#document-management)

```
use TurboTech\FileManager\Facades\FileManager;

class DocumentService
{
    public function listUserDocuments($userId)
    {
        $path = "users/{$userId}/documents";
        return FileManager::listFiles($path, true);
    }

    public function storeDocument($userId, $file, $category)
    {
        $destination = "users/{$userId}/documents/{$category}";
        return FileManager::upload($file->getPathname(), $destination);
    }

    public function archiveDocument($documentPath)
    {
        // Get file content
        $metadata = FileManager::getMetadata($documentPath);

        // Download to temporary location
        $tempPath = storage_path("temp/" . basename($documentPath));
        FileManager::download($documentPath, $tempPath);

        // Process...

        return true;
    }
}
```

Testing
-------

[](#testing)

The package includes test support. Create tests using Orchestra Testbench:

```
use Orchestra\Testbench\TestCase;
use TurboTech\FileManager\Facades\FileManager;

class FileManagerTest extends TestCase
{
    protected function getPackageProviders($app)
    {
        return ['TurboTech\FileManager\FileManagerServiceProvider'];
    }

    public function test_file_upload()
    {
        $tempFile = tempnam(sys_get_temp_dir(), 'test');
        file_put_contents($tempFile, 'test content');

        $result = FileManager::upload($tempFile, 'test');

        $this->assertTrue($result['success']);
        $this->assertNotEmpty($result['path']);
    }
}
```

License
-------

[](#license)

MIT License. See LICENSE file for details.

Support
-------

[](#support)

For issues, questions, or contributions, please visit the repository or contact the TurboTech development team.

Changelog
---------

[](#changelog)

### Version 1.0.0

[](#version-100)

- Initial release
- File upload/download support
- Multiple storage backend support
- Remote API integration
- Comprehensive configuration options

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance82

Actively maintained with recent releases

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65fc1dd4bb2db8c1b195cfc26c5ee59defc1766c3378ea5a93e794893bbeb0aa?d=identicon)[smarterp-dev](/maintainers/smarterp-dev)

---

Top Contributors

[![pphatdev](https://avatars.githubusercontent.com/u/65520537?v=4)](https://github.com/pphatdev "pphatdev (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[unisharp/laravel-filemanager

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

2.1k3.4M81](/packages/unisharp-laravel-filemanager)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9772.3M122](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.0k2.1M162](/packages/laravel-ai)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)

PHPackages © 2026

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