├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ └── run-tests.yml ├── .gitignore ├── CHANGELOG.md ├── CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── composer.json ├── src └── WebDAVServiceProvider.php └── tests └── ServiceProviderTest.php /.editorconfig: -------------------------------------------------------------------------------- 1 | ; This file is for unifying the coding style for different editors and IDEs. 2 | ; More information at http://editorconfig.org 3 | 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | indent_size = 4 9 | indent_style = space 10 | end_of_line = lf 11 | insert_final_newline = true 12 | trim_trailing_whitespace = true 13 | 14 | [*.md] 15 | trim_trailing_whitespace = false 16 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [pascalbaljet] 2 | -------------------------------------------------------------------------------- /.github/workflows/run-tests.yml: -------------------------------------------------------------------------------- 1 | name: run-tests 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | test: 7 | runs-on: ubuntu-latest 8 | strategy: 9 | fail-fast: true 10 | matrix: 11 | php: [8.1, 8.0, 7.4] 12 | laravel: [8.*] 13 | dependency-version: [prefer-lowest, prefer-stable] 14 | include: 15 | - laravel: 8.* 16 | testbench: 6.* 17 | 18 | name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} 19 | 20 | steps: 21 | - name: Checkout code 22 | uses: actions/checkout@v2 23 | 24 | - name: Cache dependencies 25 | uses: actions/cache@v2 26 | with: 27 | path: ~/.composer/cache/files 28 | key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} 29 | 30 | - name: Setup PHP 31 | uses: shivammathur/setup-php@v2 32 | with: 33 | php-version: ${{ matrix.php }} 34 | extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, mysql, mysqli, pdo_mysql 35 | coverage: none 36 | 37 | - name: Install dependencies 38 | run: | 39 | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update 40 | composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest 41 | 42 | - name: Execute tests 43 | run: vendor/bin/phpunit tests/ServiceProviderTest.php 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | composer.lock 3 | docs 4 | vendor -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All Notable changes to `laravel-webdav` will be documented in this file. 4 | 5 | Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles. 6 | 7 | ## 1.11.0 8 | - Support for PHP 8.1 9 | - Dropped support for PHP 7.3 10 | - Dropped support for Laravel 6 and 7 11 | 12 | ## 1.10.0 13 | - Support for PHP 8.0 14 | - Dropped support for PHP 7.2 15 | 16 | ## 1.9.0 17 | - Support for Laravel 8.0 18 | 19 | ## 1.8.0 20 | - Drops support for Laravel 5.x 21 | - Support for Laravel 6.x and 7.x 22 | 23 | ## 1.2.0 - 1.7.0 24 | - Support for new Laravel versions 25 | 26 | ## 1.1.0 - 2017-11-14 27 | 28 | ### Added 29 | - Support for path prefix 30 | 31 | ### Deprecated 32 | - Nothing 33 | 34 | ### Fixed 35 | - Some refactoring 36 | 37 | ### Removed 38 | - Nothing 39 | 40 | ### Security 41 | - Nothing 42 | 43 | ## 1.0.2 - 2017-08-31 44 | 45 | ### Added 46 | - Added test 47 | - Support up to Laravel 5.5 48 | 49 | ### Deprecated 50 | - Nothing 51 | 52 | ### Fixed 53 | - Some refactoring 54 | 55 | ### Removed 56 | - Nothing 57 | 58 | ### Security 59 | - Nothing -------------------------------------------------------------------------------- /CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. 6 | 7 | Examples of unacceptable behavior by participants include: 8 | 9 | * The use of sexualized language or imagery 10 | * Personal attacks 11 | * Trolling or insulting/derogatory comments 12 | * Public or private harassment 13 | * Publishing other's private information, such as physical or electronic addresses, without explicit permission 14 | * Other unethical or unprofessional conduct. 15 | 16 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. 17 | 18 | This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community in a direct capacity. Personal views, beliefs and values of individuals do not necessarily reflect those of the organisation or affiliated individuals and organisations. 19 | 20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 21 | 22 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) 23 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Contributions are **welcome** and will be fully **credited**. 4 | 5 | We accept contributions via Pull Requests on [Github](https://github.com/pbmedia/laravel-webdav). 6 | 7 | 8 | ## Pull Requests 9 | 10 | - **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). 11 | 12 | - **Add tests!** - Your patch won't be accepted if it doesn't have tests. 13 | 14 | - **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date. 15 | 16 | - **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option. 17 | 18 | - **Create feature branches** - Don't ask us to pull from your master branch. 19 | 20 | - **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. 21 | 22 | - **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting. 23 | 24 | 25 | ## Running Tests 26 | 27 | ``` bash 28 | $ composer test 29 | ``` 30 | 31 | 32 | **Happy coding**! 33 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Pascal Baljet 4 | 5 | > Permission is hereby granted, free of charge, to any person obtaining a copy 6 | > of this software and associated documentation files (the "Software"), to deal 7 | > in the Software without restriction, including without limitation the rights 8 | > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | > copies of the Software, and to permit persons to whom the Software is 10 | > furnished to do so, subject to the following conditions: 11 | > 12 | > The above copyright notice and this permission notice shall be included in 13 | > all copies or substantial portions of the Software. 14 | > 15 | > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | > THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > :warning: This package is unmaintained and doesn't work with modern Laravel apps. Consider using a [Custom Filesystem](https://laravel.com/docs/10.x/filesystem#custom-filesystems) with the new [WebDAV adapter](https://flysystem.thephpleague.com/docs/adapter/webdav/). 2 | 3 | # laravel-webdav 4 | 5 | [![Latest Version on Packagist][ico-version]][link-packagist] 6 | ![run-tests](https://github.com/protonemedia/laravel-webdav/workflows/run-tests/badge.svg) 7 | [![Software License][ico-license]](LICENSE.md) 8 | [![Total Downloads][ico-downloads]][link-downloads] 9 | 10 | This package provides a WebDAV driver for Laravel's Filesystem. Laravel 8.0 supported. 11 | 12 | ## Support 13 | 14 | We proudly support the community by developing Laravel packages and giving them away for free. Keeping track of issues and pull requests takes time, but we're happy to help! If this package saves you time or if you're relying on it professionally, please consider [supporting the maintenance and development](https://github.com/sponsors/pascalbaljet). 15 | 16 | ## Install 17 | 18 | Via Composer 19 | 20 | ``` bash 21 | $ composer require pbmedia/laravel-webdav 22 | ``` 23 | 24 | ## Usage 25 | 26 | Register the service provider in your app.php config file (Laravel 5.4 and lower only): 27 | 28 | ``` php 29 | // config/app.php 30 | 31 | 'providers' => [ 32 | ... 33 | Pbmedia\FilesystemProviders\WebDAVServiceProvider::class 34 | ... 35 | ]; 36 | ``` 37 | 38 | Create a webdav filesystem disk: 39 | 40 | ``` php 41 | // config/filesystems.php 42 | 43 | 'disks' => [ 44 | ... 45 | 'webdav' => [ 46 | 'driver' => 'webdav', 47 | 'baseUri' => 'https://mywebdavstorage.com', 48 | 'userName' => 'protonemedia', 49 | 'password' => 'supersecretpassword', 50 | 'pathPrefix' => 'backups', // optional 51 | ], 52 | ... 53 | ]; 54 | ``` 55 | 56 | ## Change log 57 | 58 | Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. 59 | 60 | ## Contributing 61 | 62 | Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details. 63 | 64 | ## Security 65 | 66 | If you discover any security related issues, please email info@protone.media instead of using the issue tracker. 67 | 68 | ## Other Laravel packages 69 | 70 | * [`Laravel Analytics Event Tracking`](https://github.com/protonemedia/laravel-analytics-event-tracking): Laravel package to easily send events to Google Analytics. 71 | * [`Laravel Blade On Demand`](https://github.com/protonemedia/laravel-blade-on-demand): Laravel package to compile Blade templates in memory. 72 | * [`Laravel Cross Eloquent Search`](https://github.com/protonemedia/laravel-cross-eloquent-search): Laravel package to search through multiple Eloquent models. 73 | * [`Laravel Eloquent Scope as Select`](https://github.com/protonemedia/laravel-eloquent-scope-as-select): Stop duplicating your Eloquent query scopes and constraints in PHP. This package lets you re-use your query scopes and constraints by adding them as a subquery. 74 | * [`Laravel Eloquent Where Not`](https://github.com/protonemedia/laravel-eloquent-where-not): This Laravel package allows you to flip/invert an Eloquent scope, or really any query constraint. 75 | * [`Laravel FFMpeg`](https://github.com/protonemedia/laravel-ffmpeg): This package provides an integration with FFmpeg for Laravel. The storage of the files is handled by Laravel's Filesystem. 76 | * [`Laravel Form Components`](https://github.com/protonemedia/laravel-form-components): Blade components to rapidly build forms with Tailwind CSS Custom Forms and Bootstrap 4. Supports validation, model binding, default values, translations, includes default vendor styling and fully customizable! 77 | * [`Laravel Mixins`](https://github.com/protonemedia/laravel-mixins): A collection of Laravel goodies. 78 | * [`Laravel Paddle`](https://github.com/protonemedia/laravel-paddle): Paddle.com API integration for Laravel with support for webhooks/events. 79 | * [`Laravel Verify New Email`](https://github.com/protonemedia/laravel-verify-new-email): This package adds support for verifying new email addresses: when a user updates its email address, it won't replace the old one until the new one is verified. 80 | 81 | ## Credits 82 | 83 | - [Pascal Baljet][link-author] 84 | - [All Contributors][link-contributors] 85 | 86 | ## License 87 | 88 | The MIT License (MIT). Please see [License File](LICENSE.md) for more information. 89 | 90 | [ico-version]: https://img.shields.io/packagist/v/pbmedia/laravel-webdav.svg?style=flat-square 91 | [ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square 92 | [ico-downloads]: https://img.shields.io/packagist/dt/pbmedia/laravel-webdav.svg?style=flat-square 93 | 94 | [link-packagist]: https://packagist.org/packages/pbmedia/laravel-webdav 95 | [link-downloads]: https://packagist.org/packages/pbmedia/laravel-webdav 96 | [link-author]: https://github.com/pascalbaljet 97 | [link-contributors]: ../../contributors 98 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "pbmedia/laravel-webdav", 3 | "type": "library", 4 | "description": "Laravel WebDAV Filesystem", 5 | "keywords": [ 6 | "pbmedia", 7 | "laravel-webdav" 8 | ], 9 | "homepage": "https://github.com/protonemedia/laravel-webdav", 10 | "license": "MIT", 11 | "authors": [ 12 | { 13 | "name": "Pascal Baljet", 14 | "email": "info@protone.media", 15 | "homepage": "https://protone.media", 16 | "role": "Developer" 17 | } 18 | ], 19 | "require": { 20 | "php": "^7.4 || ^8.0 || ^8.1", 21 | "illuminate/filesystem": "^8.67", 22 | "league/flysystem-webdav": "^1.0" 23 | }, 24 | "require-dev": { 25 | "orchestra/testbench": "^6.23", 26 | "phpunit/phpunit": "^9.4" 27 | }, 28 | "autoload": { 29 | "psr-4": { 30 | "Pbmedia\\FilesystemProviders\\": "src" 31 | } 32 | }, 33 | "autoload-dev": { 34 | "psr-4": { 35 | "Pbmedia\\FilesystemProviders\\Tests\\": "tests" 36 | } 37 | }, 38 | "scripts": { 39 | "test": "vendor/bin/phpunit" 40 | }, 41 | "config": { 42 | "sort-packages": true 43 | }, 44 | "minimum-stability": "dev", 45 | "prefer-stable": true, 46 | "extra": { 47 | "laravel": { 48 | "providers": [ 49 | "Pbmedia\\FilesystemProviders\\WebDAVServiceProvider" 50 | ] 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /src/WebDAVServiceProvider.php: -------------------------------------------------------------------------------- 1 | set('filesystems.disks.webdav', [ 19 | 'driver' => 'webdav', 20 | 'baseUri' => 'https://mywebdavstorage.com', 21 | 'userName' => 'pascalbaljetmedia', 22 | 'password' => 'supersecretpassword', 23 | ]); 24 | } 25 | 26 | /** @test */ 27 | public function it_registers_a_webdav_driver() 28 | { 29 | $filesystem = Storage::disk('webdav'); 30 | $driver = $filesystem->getDriver(); 31 | $adapter = $driver->getAdapter(); 32 | 33 | $this->assertInstanceOf(WebDAVAdapter::class, $adapter); 34 | } 35 | 36 | /** @test */ 37 | public function it_can_have_an_optional_path_prefix() 38 | { 39 | $this->app['config']->set('filesystems.disks.webdav.pathPrefix', 'prefix'); 40 | 41 | $filesystem = Storage::disk('webdav'); 42 | $driver = $filesystem->getDriver(); 43 | $adapter = $driver->getAdapter(); 44 | 45 | $this->assertInstanceOf(WebDAVAdapter::class, $adapter); 46 | $this->assertEquals('prefix/', $adapter->getPathPrefix()); 47 | } 48 | } 49 | --------------------------------------------------------------------------------