An open API service indexing awesome lists of open source software.

https://github.com/matthewbdaly/laravel-gridfs-storage

MongoDB GridFS integration for Laravel's Storage API
https://github.com/matthewbdaly/laravel-gridfs-storage

Last synced: 3 months ago
JSON representation

MongoDB GridFS integration for Laravel's Storage API

Awesome Lists containing this project

README

        

# laravel-gridfs-storage
MongoDB GridFS integration for Laravel's Storage API

# Installation

Install the package using composer:

```bash
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:

```php
Matthewbdaly\LaravelGridFSStorage\GridFSStorageServiceProvider::class,
```

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

```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.