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
- Host: GitHub
- URL: https://github.com/matthewbdaly/laravel-gridfs-storage
- Owner: matthewbdaly
- License: mit
- Created: 2017-11-14T10:32:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-11-14T11:42:18.000Z (over 7 years ago)
- Last Synced: 2025-01-21T07:09:09.354Z (5 months ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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.