matthewbdaly/laravel-gridfs-storage

This package is abandoned and no longer maintained. No replacement package was suggested.

MongoDB GridFS integration for Laravel's Storage API

1.0.2 2017-11-14 11:36 UTC

This package is auto-updated.

Last update: 2022-02-01 13:11:01 UTC


README

MongoDB GridFS integration for Laravel's Storage API

Installation

Install the package using composer:

composer require matthewbdaly/laravel-gridfs-storage

On Laravel versions before 5.5 you also need to add the service provider to config/app.php manually:

    Matthewbdaly\LaravelGridFSStorage\GridFSStorageServiceProvider::class,

Then add this to the disks section of config/filesystems.php:

        'gridfs' => [
            'driver'    => 'gridfs',
            'name'      => env('GRIDFS_STORAGE_NAME'),
        ],

Finally, add the field GRIDFS_STORAGE_NAME to your .env file with the appropriate credentials. Then you can set the gridfs driver as either your default or cloud driver and use it to fetch and retrieve files as usual.

MongoClient is deprecated...

Unfortunately, league/flysystem-gridfs hasn't been updated to reflect this. When it is, I'll be in a position to make this work with it.