nino / laravel-nextcloud-fs
Laravel Nextcloud Filesystem
Requires
- php: ^8.1
- illuminate/filesystem: ^10.38 || ^9.52
- league/flysystem-webdav: ^3.21
- sabre/uri: >=2.1.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.41
- orchestra/testbench: ^8.18 || ^v7.38
- phpunit/phpunit: ^10.1 || ^9.6
This package is auto-updated.
Last update: 2024-04-21 12:55:46 UTC
README
This package provides a Nextcloud driver for Laravel's Filesystem.
It's a wrapper around Flysystem's WebDAV Adapter.
Compatibility
Laravel : 10, 9
PHP : 8.3, 8.2, 8.1
Install
Via Composer
composer require nino/laravel-nextcloud-fs
Usage
Generate a Nextcloud app password on the desired user's account: Settings > Security > Devices & sessions.
Create a nextcloud
filesystem disk:
// config/filesystems.php 'disks' => [ ... 'nextcloud' => [ 'driver' => 'nextcloud', 'baseUri' => 'https://nextcloud.example.org', 'userName' => 'laravel', 'password' => 'password-generated-by-nextcloud', 'directory' => '', // optionnal: set a path as visible for nextcloud user defined in userName ], ... ];
Use it as any Laravel filesystem : https://laravel.com/docs/filesystem
use Illuminate\Support\Facades\Storage; Storage::disk('nextcloud')->put('example.txt', 'Contents');
Note that file visibility features aren't supported (it's a WebDAV limitation).
Contributing
Merge requests, bug reports and suggestions are welcome.
Please follow the following rules on your pull requests:
- One pull request per feature.
- Make sure each individual commit in your pull request is meaningful.
- Document any change in behaviour.
- Update the tests if necessary.
License
This library is licensed under the MIT License. Please read the license file for more information.
It's based on the work of Protone Media : pbmedia/laravel-webdav (also under MIT license).