PHPackages                             piotr-grabowski-elastique/laravel-vfs-adapter - 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. piotr-grabowski-elastique/laravel-vfs-adapter

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

piotr-grabowski-elastique/laravel-vfs-adapter
=============================================

Virtual Filesystem Storage Adapter for Laravel

v3.1.0(6y ago)07MITPHPPHP &gt;=7.0.0

Since Mar 1Pushed 5y agoCompare

[ Source](https://github.com/piotrgrabowskielastique/laravel-vfs-adapter)[ Packagist](https://packagist.org/packages/piotr-grabowski-elastique/laravel-vfs-adapter)[ RSS](/packages/piotr-grabowski-elastique-laravel-vfs-adapter/feed)WikiDiscussions master Synced 1mo ago

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

Laravel Storage Virtual File System Adapter
===========================================

[](#laravel-storage-virtual-file-system-adapter)

Sometimes, when we are testing, it would be very nice to just easily swap out the various `Storage:disk()` calls with a virtual files system like `mikey179/vfsStream`.

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

[](#installation)

```
composer require stechstudio/laravel-vfs-adapter

```

Then register the provider in your `App\Providers\AppServiceProvider` like so:

```
public function register()
{
    if ($this->app->environment() === 'testing') {
        if (class_exists(VfsFilesystemServiceProvider::class)) {
            $this->app->register(VfsFilesystemServiceProvider::class);
        }
    }
}
```

This assumes you stick with the default `APP_ENV=testing` settings that Laravel comes with out of the box. Of course, you may also register the provider in the more traditional manner if you want the virtual file system adapter available in other environments, of it you just don't like the way we do it.

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

[](#configuration)

All configuration can be done in a combination of your `.env`, `phpunit.xml`, and `config/filesystems.php`.

Suppose you had a `config/filesystems.php` that looked something like this:

```
return [
    ....

    'disks' => [
        'data' => [
            'driver' => 'local',
            'root'   => env('STORAGE_DATA_DIR'),
        ],

        'archive' => [
            'driver'   => 's3'
            'key'      => env('S3_KEY'),
            'secret'   => env('S3_SECRET'),
            'region'   => env('S3_REGION'),
            'bucket'   => env('S3_DEVELOP_BUCKET')
        ]
    ],
];
```

Simply make a few modifications:

```
return [
    ....

    'disks' => [

        'data' => [
            'driver' => env('STORAGE_DATA_DRIVER', 'local'),
            'root'   => env('STORAGE_DATA_DIR'),
            'dir_name' => 'data'
        ],

        'archive' => [
            'driver'   => env('S3_ARCHIVE_DRIVER', 's3')
            'key'      => env('S3_KEY'),
            'secret'   => env('S3_SECRET'),
            'region'   => env('S3_REGION'),
            'bucket'   => env('S3_DEVELOP_BUCKET'),
            'dir_name' => 'archive'
        ]
    ],
];
```

The `dir_name` determines the root directory of the vfsStream for that particular `Storage::disk()`, I like to name it something relative to the actual `disk` name. Setting up the driver with `env()` allows us to default to our standard drivers or allow us to override that in `phpunit.xml` to switch over to the virtual filesystem driver.

Now, in your `phpunit.xml` add:

```

```

That is all there is to it, those drives will now use the virtual filesystem adapter.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 79.6% 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 ~157 days

Recently: every ~165 days

Total

8

Last Release

2255d ago

Major Versions

1.0.1 → 2.0.02017-10-19

2.1.0 → 3.0.02019-10-05

PHP version history (2 changes)1.0.1PHP &gt;=5.6

2.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/87e6968f125e352a4828b859e3384775aee2674b0380bdbc892512532b8b8385?d=identicon)[piotr.grabowski.elastique](/maintainers/piotr.grabowski.elastique)

---

Top Contributors

[![bubba-h57](https://avatars.githubusercontent.com/u/603630?v=4)](https://github.com/bubba-h57 "bubba-h57 (39 commits)")[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (7 commits)")[![piotrgrabowskielastique](https://avatars.githubusercontent.com/u/47775107?v=4)](https://github.com/piotrgrabowskielastique "piotrgrabowskielastique (2 commits)")[![RafaelKr](https://avatars.githubusercontent.com/u/14234815?v=4)](https://github.com/RafaelKr "RafaelKr (1 commits)")

---

Tags

Flysystemlaravellumenadapterstoragevfsphp-vs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/piotr-grabowski-elastique-laravel-vfs-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/piotr-grabowski-elastique-laravel-vfs-adapter/health.svg)](https://phpackages.com/packages/piotr-grabowski-elastique-laravel-vfs-adapter)
```

###  Alternatives

[websight/l5-google-cloud-storage

Laravel 5 Flysystem Google Cloud Storage Service Provider

3662.2k](/packages/websight-l5-google-cloud-storage)[zing/laravel-flysystem-obs

Flysystem Adapter for OBS

1211.2k](/packages/zing-laravel-flysystem-obs)

PHPackages © 2026

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