This package provides a Nextcloud driver for Laravel's Filesystem.
It's a wrapper around Flysystem's WebDAV Adapter.
Laravel : 11, 10
PHP : 8.3, 8.2
Via Composer
composer require nino/laravel-nextcloud-fs
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).
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.
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).