PHPackages                             arshad1114/laravel-dms-disk - 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. arshad1114/laravel-dms-disk

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

arshad1114/laravel-dms-disk
===========================

A custom Laravel filesystem disk driver for Document Management Services over HTTP.

v1.0.9(3mo ago)411MITPHPPHP ^8.1CI passing

Since Mar 15Pushed 3mo agoCompare

[ Source](https://github.com/Arshad1114/laravel-dms-disk)[ Packagist](https://packagist.org/packages/arshad1114/laravel-dms-disk)[ RSS](/packages/arshad1114-laravel-dms-disk/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (12)Used By (0)

Laravel DMS Disk
================

[](#laravel-dms-disk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/21f5f3f24d6eaf3edbd0e8a0c01d5717ad26d7c5fa8b97dda603bd1b43ba614a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617273686164313131342f6c61726176656c2d646d732d6469736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arshad1114/laravel-dms-disk)[![Total Downloads](https://camo.githubusercontent.com/6a53de22cc3c6d41721c21f61599096e3ccd828c6ca31e4efcc537f8794cf403/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617273686164313131342f6c61726176656c2d646d732d6469736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arshad1114/laravel-dms-disk)[![License](https://camo.githubusercontent.com/55c32ea5a50e323d4b8a111d56cc6a90e09244dc5df44f40baaad64bf9e7e705/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f617273686164313131342f6c61726176656c2d646d732d6469736b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/arshad1114/laravel-dms-disk)[![Try in Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/arshad1114/laravel-dms-disk-demo)

A custom Laravel filesystem disk driver that lets any Laravel microservice store, retrieve and manage files on a remote Document Management Service (DMS) using the **native `Storage` facade** — no custom HTTP calls, no helper functions, no boilerplate.

Try it online — no install needed
---------------------------------

[](#try-it-online--no-install-needed)

Click the button above to launch a live demo in your browser using GitHub Codespaces. Both services start automatically — no setup required.

Once the Codespace loads:

```
bash .devcontainer/start.sh
```

Open a new terminal:

```
cd consumer-service && php artisan tinker
```

Then try:

```
Storage::disk('dms')->put('test/hello.txt', 'Hello World!');
Storage::disk('dms')->get('test/hello.txt');
Storage::disk('dms')->delete('test/hello.txt');
```

The problem
-----------

[](#the-problem)

In a microservice architecture, when a service needs to store files on a dedicated DMS service, developers typically write custom HTTP calls in every service:

```
// ❌ what developers do today — repeated in every service
$response = Http::attach('file', $contents, 'invoice.pdf')
    ->post('https://dms.internal/upload', ['path' => 'invoices/001.pdf']);
```

The solution
------------

[](#the-solution)

Install this package and use the native `Storage` facade as you always have:

```
// ✅ with laravel-dms-disk
Storage::disk('dms')->put('invoices/001.pdf', $contents);
Storage::disk('dms')->get('invoices/001.pdf');
Storage::disk('dms')->delete('invoices/001.pdf');
```

The HTTP transport is completely invisible.

How it works
------------

[](#how-it-works)

```
Consumer service                         DMS service
────────────────                         ───────────────────────────
Storage::disk('dms')->put(...)           Receives the HTTP request
       │                                 Calls Storage::put(...)
       │           HTTPS                 using its own
       └──────────────────────────────►  filesystems.php config

```

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

[](#requirements)

- PHP 8.1+
- Laravel 10, 11, or 12

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

[](#installation)

```
composer require arshad1114/laravel-dms-disk
```

The `DmsServiceProvider` is auto-discovered — no manual registration needed.

Publish the config:

```
php artisan vendor:publish --tag=dms-disk-config
```

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

[](#configuration)

Add to your `.env`:

```
DMS_URL=https://your-dms-service.internal
DMS_TOKEN=your-strong-secret-token
```

Add the `dms` disk to `config/filesystems.php`:

```
'disks' => [
    // ... your existing disks

    'dms' => [
        'driver' => 'dms',
    ],
],
```

### Disk selection

[](#disk-selection)

By default the DMS server uses its own configured default disk (`FILESYSTEM_DISK` in the DMS `.env`). You only need to set `DMS_DISK` if you want to target a specific disk on the DMS server:

```
# Use DMS server default disk — recommended
DMS_DISK=

# Or target a specific disk on the DMS server
DMS_DISK=client
```

You can also set it per disk in `config/filesystems.php`:

```
'dms' => [
    'driver' => 'dms',
    'disk'   => 'client',  // store on the client disk on the DMS server
],
```

### Full config reference

[](#full-config-reference)

All options in `config/dms-disk.php`:

KeyEnv variableDefaultDescription`url``DMS_URL``''`Base URL of your DMS service`token``DMS_TOKEN``''`Bearer token for authentication`disk``DMS_DISK``null`Disk name on the DMS server. If not set, DMS server uses its own default disk`timeout``DMS_TIMEOUT``30`HTTP timeout in seconds`retry``DMS_RETRY``3`Retry attempts on connection failure`retry_delay``DMS_RETRY_DELAY``200`Milliseconds between retries### Multiple DMS disks

[](#multiple-dms-disks)

You can point multiple disks to different DMS services or different disks on the same DMS service:

```
'disks' => [
    // Uses DMS server default disk
    'dms' => [
        'driver' => 'dms',
        'url'    => env('DMS_URL'),
        'token'  => env('DMS_TOKEN'),
    ],

    // Targets the client disk on the DMS server
    'dms-client' => [
        'driver' => 'dms',
        'url'    => env('DMS_URL'),
        'token'  => env('DMS_TOKEN'),
        'disk'   => 'client',
    ],

    // Points to a completely different DMS service
    'dms-archive' => [
        'driver' => 'dms',
        'url'    => env('DMS_ARCHIVE_URL'),
        'token'  => env('DMS_ARCHIVE_TOKEN'),
    ],
],
```

Usage
-----

[](#usage)

### Upload a file

[](#upload-a-file)

```
// From a string
Storage::disk('dms')->put('invoices/001.pdf', $pdfContents);

// From an uploaded file in a controller
$request->file('document')->store('documents', 'dms');

// With a custom filename
$request->file('document')->storeAs('documents', 'invoice-001.pdf', 'dms');

// As public visibility
Storage::disk('dms')->put('avatars/user-1.jpg', $imageContents, 'public');
```

### Download a file

[](#download-a-file)

```
// Get file contents as string
$contents = Storage::disk('dms')->get('invoices/001.pdf');

// Stream download directly to browser
return Storage::disk('dms')->download('invoices/001.pdf');

// Stream with custom filename
return Storage::disk('dms')->download('invoices/001.pdf', 'my-invoice.pdf');
```

### Check existence

[](#check-existence)

```
if (Storage::disk('dms')->exists('invoices/001.pdf')) {
    // file exists
}

if (Storage::disk('dms')->missing('invoices/001.pdf')) {
    // file does not exist
}
```

### Delete a file

[](#delete-a-file)

```
Storage::disk('dms')->delete('invoices/001.pdf');
```

### Move and copy

[](#move-and-copy)

```
// Move (rename)
Storage::disk('dms')->move('old/path.pdf', 'new/path.pdf');

// Copy
Storage::disk('dms')->copy('original.pdf', 'copy.pdf');
```

### List files

[](#list-files)

```
// Files in a directory
$files = Storage::disk('dms')->files('invoices');

// Files recursively
$files = Storage::disk('dms')->allFiles('invoices');
```

### File metadata

[](#file-metadata)

```
$size      = Storage::disk('dms')->size('invoices/001.pdf');
$mime      = Storage::disk('dms')->mimeType('invoices/001.pdf');
$timestamp = Storage::disk('dms')->lastModified('invoices/001.pdf');
```

### URLs

[](#urls)

```
// Public URL
$url = Storage::disk('dms')->url('avatars/user-1.jpg');

// Temporary signed URL
$url = Storage::disk('dms')->temporaryUrl('invoices/001.pdf', now()->addHour());
```

### Visibility

[](#visibility)

```
Storage::disk('dms')->setVisibility('avatars/user-1.jpg', 'public');
Storage::disk('dms')->setVisibility('invoices/001.pdf', 'private');

$visibility = Storage::disk('dms')->visibility('avatars/user-1.jpg');
// returns 'public' or 'private'
```

Troubleshooting
---------------

[](#troubleshooting)

### 401 Unauthorized

[](#401-unauthorized)

`DMS_TOKEN` in the consumer does not match `DMS_SERVER_TOKEN` in the DMS service. Make sure both values are identical.

### Driver \[dms\] not supported

[](#driver-dms-not-supported)

The `dms` disk is missing from `config/filesystems.php`. Add it as shown in the configuration section above.

### Connection refused / timeout

[](#connection-refused--timeout)

`DMS_URL` is wrong or the DMS service is not running. Double check the URL and port.

### Routes not found on DMS side

[](#routes-not-found-on-dms-side)

Run `php artisan route:clear` on the DMS service and check `php artisan route:list --path=dms-disk`.

### File storing on wrong disk

[](#file-storing-on-wrong-disk)

If files are storing on the wrong disk on the DMS server, check `DMS_DISK` in your consumer `.env`. If it is set to `local` explicitly, clear it so the DMS server uses its own default:

```
DMS_DISK=
```

### ServiceProvider not found

[](#serviceprovider-not-found)

If you get `Driver [dms] not supported`, run:

```
php artisan package:discover
php artisan config:clear
```

If still not working, register the provider manually in `bootstrap/providers.php` (Laravel 11+):

```
Arshad1114\DmsDisk\Consumer\DmsServiceProvider::class,
```

Or in `config/app.php` (Laravel 10):

```
'providers' => [
    Arshad1114\DmsDisk\Consumer\DmsServiceProvider::class,
],
```

DMS server packages
-------------------

[](#dms-server-packages)

Your DMS service can be written in any language that implements the API contract. Official server packages:

FrameworkPackageLaravel[arshad1114/laravel-dms-disk-server](https://github.com/arshad1114/laravel-dms-disk-server)Node.jsComing soonContributing
------------

[](#contributing)

Contributions are welcome. Please:

1. Fork the repo
2. Create a feature branch: `git checkout -b feat/your-feature`
3. Write tests for your change
4. Make sure all tests pass: `./vendor/bin/phpunit`
5. Open a pull request

License
-------

[](#license)

MIT — see [LICENSE](LICENSE) file.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance81

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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 ~0 days

Total

7

Last Release

102d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1782336461e5d806d22b26d3ebaa4e48908cf22596c92721fce6445ddeebb53f?d=identicon)[arshad1114](/maintainers/arshad1114)

---

Top Contributors

[![Arshad1114](https://avatars.githubusercontent.com/u/48760119?v=4)](https://github.com/Arshad1114 "Arshad1114 (16 commits)")

---

Tags

dmsfilesystemlaravelmicroservicephpstoragefilesystemlaravelstoragedmsMicroservice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arshad1114-laravel-dms-disk/health.svg)

```
[![Health](https://phpackages.com/badges/arshad1114-laravel-dms-disk/health.svg)](https://phpackages.com/packages/arshad1114-laravel-dms-disk)
```

###  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)[psalm/plugin-laravel

Psalm plugin for Laravel

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

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

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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