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

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

ost/laravel-file-manager
========================

This package used to upload,update and delete single or multiple file and more..

v0.1.0(3y ago)032MITPHPPHP ^7.3|^8.0

Since Mar 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Osama-AL-Tawil/laravel-file-manager)[ Packagist](https://packagist.org/packages/ost/laravel-file-manager)[ Docs](https://github.com/Osama-AL-Tawil/laravel-file-manager)[ RSS](/packages/ost-laravel-file-manager/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Overview
========

[](#overview)

```
This package deals with the operations that occur on files,
such as uploading, updating, fetching, or deleting a file.
```

### Installation

[](#installation)

```
composer required ost/laravel-file-manager
```

#### Publish Package

[](#publish-package)

```
php artisan vendor:publish --provider="OST\LaravelFileManager\LaravelFileManagerServiceProvider"
```

```
created files
config/laravel_file_manager.php
database/migrations/create_files_table.php
```

#### Migrate to create table in database

[](#migrate-to-create-table-in-database)

```
php artisan migrate
```

### Notes

[](#notes)

```
1- The default disk is [public]
2- You can change disk from .env by change FILESYSTEM_DISK=public
```

Usage
-----

[](#usage)

Upload File
-----------

[](#upload-file)

You can upload one or more file

```
        FileManager::setRequest($request)
            ->setUserId(1)
            ->setModelName(User::class)
            ->setFilePath('/user/1/images')
            ->uploadFile();
```

Update File
-----------

[](#update-file)

#### Update File By Url

[](#update-file-by-url)

You can update the files by passing the files that you want to upload in the request and passing the urls of the files that you want to update to be deleted from storage

```
        FileManager::setRequest($request)
            ->setUserId(1)
            ->setModelName(User::class)
            ->setFilePath('/user/1/images')
            ->updateFileByUrl(['url1','url2']);
```

#### Update File By Path

[](#update-file-by-path)

You can update the files by passing the files that you want to upload in the request and passing the paths of the files that you want to update to be deleted from storage

```
        FileManager::setRequest($request)
            ->setUserId(1)
            ->setModelName(User::class)
            ->setFilePath('/user/1/images')
            ->updateFileByPath(['path1','path2']);
```

Delete File
-----------

[](#delete-file)

#### Delete File by Url

[](#delete-file-by-url)

```
        FileManager::deleteFileByUrl(['url1','url2'],user_id);
```

#### Delete File by File Path

[](#delete-file-by-file-path)

You can pass file paths directly

```
        FileManager::deleteFileByPath(['path1','path2'],user_id);
```

Customisation
-------------

[](#customisation)

#### Set Model Name and ID

[](#set-model-name-and-id)

We do this to enable you to create relationships between tables

```
        FileManager::setRequest($request)
            ->setModelName() // like => Post::class,Message::class
            ->setModelId() // like => post_id , message_id

```

#### Set max file size

[](#set-max-file-size)

```
        FileManager::setRequest($request)
            ->setMaxFileSizeKB(8000)

```

#### Set disk

[](#set-disk)

```
        FileManager::setRequest($request)
            ->setDisk(disk_name)

```

#### Set Allowed File Extensions (MimeType)

[](#set-allowed-file-extensions-mimetype)

```
              FileManager::setRequest($request)
              ->setAllowedExtensions('jpg,png,mp4')

```

#### Set Request File Key

[](#set-request-file-key)

default value for =&gt; file\_key: 'file'

```
       FileManager::setRequest(request: $request,file_key: 'file',file_is_required: true)
```

#### Make File Upload or update is optional

[](#make-file-upload-or-update-is-optional)

default value for =&gt; file\_is\_required: true change to false

```
       FileManager::setRequest(request: $request,file_key: 'file',file_is_required: false)
```

Get Url For File
----------------

[](#get-url-for-file)

You can get file url and mime type or only url for file by passing file path

```
 FileManager::getUrl('user/1/images/YFSCBjbOCRQ7At7J7uX4cihDcZkf7j.png',true);
```

The return result =&gt; { "url": "", "type": "png" }

Encrypt File path
-----------------

[](#encrypt-file-path)

You can encrypt file path but you must to create new disk in filesystem because public disk not with encrypted url To enable this feature

###### config/laravel\_file\_manager.php

[](#configlaravel_file_managerphp)

```
    'encrypted_url'=>true
```

### Create New Disk

[](#create-new-disk)

###### config/filesystems.php

[](#configfilesystemsphp)

```
   'disks' => [

  'disk_name' => [
            'driver' => 'local',
            'root' => storage_path('app/disk_name'),
            'url' => env('APP_URL').'/disk_name',
        ],

    ]
```

###### .env

[](#env)

```
FILESYSTEM_DISK=disk_name
```

When get File Url ,the returned url like this:
{ "url": "[http://127.0.0.1:8000/disk\_name/eyJpdiI6IktKVlRTOENwUnJ5a3VTOG5CNzJsYVE9PSIsInZhbHVlIjoiY25wbEZlYUsxeEhNUXdhWnBSZHgwNlhwRzk1UDJXY0MyTyt4R1NqQjdDS1owRk4vTFdqQWFQU0d3U2h2Z1FBK0Y0TVZCazBRWFNpR2xwOTlpMHBwS2c9PSIsIm1hYyI6IjdjMDgwYTUzOTcxYjMyNWQ2Y2UwNTI5MDI5NmQ0ZjA5YTA0YzU2NjgxMjAxZGZmN2I2YjU5YTMzMjRiMWRkNjMiLCJ0YWciOiIifQ==](http://127.0.0.1:8000/disk_name/eyJpdiI6IktKVlRTOENwUnJ5a3VTOG5CNzJsYVE9PSIsInZhbHVlIjoiY25wbEZlYUsxeEhNUXdhWnBSZHgwNlhwRzk1UDJXY0MyTyt4R1NqQjdDS1owRk4vTFdqQWFQU0d3U2h2Z1FBK0Y0TVZCazBRWFNpR2xwOTlpMHBwS2c9PSIsIm1hYyI6IjdjMDgwYTUzOTcxYjMyNWQ2Y2UwNTI5MDI5NmQ0ZjA5YTA0YzU2NjgxMjAxZGZmN2I2YjU5YTMzMjRiMWRkNjMiLCJ0YWciOiIifQ==)", "type": "png" }

Advanced
--------

[](#advanced)

#### - You can use File Eloquent model

[](#--you-can-use-file-eloquent-model)

```
\OST\LaravelFileManager\Models\File::
```

#### - You can receive requests for get and customizing files through

[](#--you-can-receive-requests-for-get-and-customizing-files-through)

###### config/laravel\_file\_manager.php

[](#configlaravel_file_managerphp-1)

Change value from true to false

```
    'get_file_route'=>false
```

###### routes/web.php

[](#routeswebphp)

Add Route in routes/web to receive request

```
     Route::get('/storage/' . '{path}', function ($path) {
     return \OST\LaravelFileManager\FileManager::getFileByRoute($path,$disk,false)
     });
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

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

1151d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b481360cffad714904c7c6412a3c21c2d2161d9a48042b4905f3d5f33284f19?d=identicon)[OST](/maintainers/OST)

---

Top Contributors

[![Osama-AL-Tawil](https://avatars.githubusercontent.com/u/58089790?v=4)](https://github.com/Osama-AL-Tawil "Osama-AL-Tawil (7 commits)")

---

Tags

laravelfilefile managerlaravel file managerupload imageUpload fileslaravel filelaravel upload file

### Embed Badge

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

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

###  Alternatives

[mafftor/laravel-file-manager

The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox

3619.3k](/packages/mafftor-laravel-file-manager)[itskodinger/midia

Simple Media manager for your Laravel project

1415.8k](/packages/itskodinger-midia)

PHPackages © 2026

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