Giter Site home page Giter Site logo

laravel-webdav's Introduction

โš ๏ธ This package is unmaintained and doesn't work with modern Laravel apps. Consider using a Custom Filesystem with the new WebDAV adapter.

laravel-webdav

Latest Version on Packagist run-tests Software License Total Downloads

This package provides a WebDAV driver for Laravel's Filesystem. Laravel 8.0 supported.

Support

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.

Install

Via Composer

$ composer require pbmedia/laravel-webdav

Usage

Register the service provider in your app.php config file (Laravel 5.4 and lower only):

// config/app.php

'providers' => [
    ...
    Pbmedia\FilesystemProviders\WebDAVServiceProvider::class
    ...
];

Create a webdav filesystem disk:

// config/filesystems.php

'disks' => [
	...
	'webdav' => [
	    'driver'     => 'webdav',
	    'baseUri'    => 'https://mywebdavstorage.com',
	    'userName'   => 'protonemedia',
	    'password'   => 'supersecretpassword',
	    'pathPrefix' => 'backups', // optional
	],
	...
];

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Other Laravel packages

  • Laravel Analytics Event Tracking: Laravel package to easily send events to Google Analytics.
  • Laravel Blade On Demand: Laravel package to compile Blade templates in memory.
  • Laravel Cross Eloquent Search: Laravel package to search through multiple Eloquent models.
  • 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.
  • Laravel Eloquent Where Not: This Laravel package allows you to flip/invert an Eloquent scope, or really any query constraint.
  • Laravel FFMpeg: This package provides an integration with FFmpeg for Laravel. The storage of the files is handled by Laravel's Filesystem.
  • 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!
  • Laravel Mixins: A collection of Laravel goodies.
  • Laravel Paddle: Paddle.com API integration for Laravel with support for webhooks/events.
  • 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.

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-webdav's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

laravel-webdav's Issues

error when using WebDAV w/ Nextcloud (read+write)

I have setup a Nextcloud shared folder (upload + edit permissions), which can be accessed using WebDAV.
But when connecting through Laravel I get errors.

My config:

        'webdav' => [
            'driver'     => 'webdav',
            'baseUri'    => env('WEBDAV_URI'),
            'userName'   => env('WEBDAV_TOKEN'), // no password is used, but same result when I do enable+add one
        ],

Works fine with curl

echo "hello" > /var/tmp/tempfile.txt; curl -T /var/tmp/tempfile.txt --user "$WEBDAV_TOKEN:" $WEBDAV_URI/tempfile.txt
curl --user "$WEBDAV_TOKEN:" $WEBDAV_URI/tempfile.txt
hello

When using Tinker I get error messages:

Storage::disk('webdav')->get('tempfile.txt')
Illuminate/Contracts/Filesystem/FileNotFoundException with message 'File not found at path: tempfile.txt'

Storage::disk('webdav')->put('testupload.txt', 'test123')
false

When I use an incorrect WEBDAV_TOKEN, curl gives authentication error message, Tinker gives the same result (no authentication error message).

error using laravel-webdav(NextCloud) with spatie/backup

Hello,
I'm using spatie/laravel-backup to do backups to a Nextcloud drive (webdav)

'backups' => [
'driver' => 'webdav',
'baseUri' => 'https://nextcloud.com//remote.php/dav/files/user/',
'userName' => 'user',
'password' => '******',
'pathPrefix' => '', // optional
],

The driver works fine. I can use laravel tinker and put or get any file.
But running "php artisan backup:run" produce an error BackupDestination.php(88):
"necessary data rewind wasn't possible"

    $handle = fopen($file, 'r+');

// this command catch an error  //
    **$this->disk->getDriver()->writeStream(
        $destination,
        $handle,
        $this->getDiskOptions()
    );**

    if (is_resource($handle)) {
        fclose($handle);
    }

Can you help me?

Thanks in advance

list files: empty result and/or Sabre Exception

I have a webdav folder containing:

- <my webdav location>
  readme.md
  - testfolder
    readme.md

When listing files in root directory:

Storage::disk('webdav')->files() // Sabre\HTTP\ClientHttpException with message 'Method Not Allowed'
Storage::disk('webdav')->files('/') // Sabre\HTTP\ClientHttpException with message 'Method Not Allowed'

When listing specific file or folder I get an empty result:

Storage::disk('webdav')->files('Readme.md') // []
Storage::disk('webdav')->files('testfolder') // []
Storage::disk('webdav')->files('testfolder/') // []

Correct / expected behavior when listing non-existing file/folder:

Storage::disk('webdav')->files('doesnotexist') // correct: Sabre\HTTP\ClientHttpException with message 'Not Found'

Correct / expected behavior when using local filesystem:

Storage::disk('local')->files()
=> [
     ".gitignore",
   ]

(using WEBDAV_URI with trailing /, see #9)

Manual curl examples works fine:

curl -X PROPFIND --user "$WEBDAV_TOKEN:" "$WEBDAV_URI"
curl -X PROPFIND --user "$WEBDAV_TOKEN:" "$WEBDAV_URI/Readme.md"
curl -X PROPFIND --user "$WEBDAV_TOKEN:" "$WEBDAV_URI/testfolder"

e.g.

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:"
	xmlns:s="http://sabredav.org/ns"
	xmlns:oc="http://owncloud.org/ns"
	xmlns:nc="http://nextcloud.org/ns">
	<d:response>
		<d:href>/public.php/webdav/testfolder/</d:href>
		<d:propstat>
			<d:prop>
				<d:getlastmodified>Fri, 08 Jan 2021 14:15:11 GMT</d:getlastmodified>
				<d:resourcetype>
					<d:collection/>
				</d:resourcetype>
				<d:quota-used-bytes>6</d:quota-used-bytes>
				<d:quota-available-bytes>-3</d:quota-available-bytes>
				<d:getetag>&quot;5f37wf868fehjekhef1cfh210&quot;</d:getetag>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
	</d:response>
	<d:response>
		<d:href>/public.php/webdav/testfolder/Readme.md</d:href>
		<d:propstat>
			<d:prop>
				<d:getlastmodified>Fri, 08 Jan 2021 14:15:11 GMT</d:getlastmodified>
				<d:getcontentlength>6</d:getcontentlength>
				<d:resourcetype/>
				<d:getetag>&quot;ea8e2f6d3h2fjefeg87b54cb7998dd58da&quot;</d:getetag>
				<d:getcontenttype>text/markdown</d:getcontenttype>
			</d:prop>
			<d:status>HTTP/1.1 200 OK</d:status>
		</d:propstat>
		<d:propstat>
			<d:prop>
				<d:quota-used-bytes/>
				<d:quota-available-bytes/>
			</d:prop>
			<d:status>HTTP/1.1 404 Not Found</d:status>
		</d:propstat>
	</d:response>
</d:multistatus>

How to interact with caldav / cardav ?

Hi !

I found your project while looking for ways to build a basic caldav / carddav client using laravel.
It is a simple project to familiarize myself with laravel. In short I would like display and manage contacts and calendar events or tasks.

I have been reading a bit about sabredav, wich seems to be the right library for the it.
To my surprise I didn't find a lot of infos about how to integrate sabredav into laravel framework.

Am I right to understand that it is what laravel-webdav is doing ?

The README description focuses on filesystem, can it be adapted to interact with caldav calendars / carddav addessbook ?
Could you maybe point me in the right direction on how to do that ?

Thanks a lot !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.