n3xt0r/laravel-webdav-server 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

n3xt0r/laravel-webdav-server

Composer 安装命令:

composer require n3xt0r/laravel-webdav-server

包简介

A WebDAV server implementation for Laravel based on SabreDAV, with support for Laravel filesystem disks.

README 文档

README

Latest Version on Packagist Security Rating Develop Status GitHub Tests Action Status Read the Docs Maintainability Code Coverage Enterprise Ready

A WebDAV server package for Laravel powered by SabreDAV and Laravel Flysystem.

It exposes Laravel storage disks through /webdav/{space}/{path?} and maps each request to a configured storage space with a user-scoped root path.

Laravel WebDAV Server Logo

Documentation

The full documentation is available on Read the Docs:

👉 https://laravel-webdav-server.readthedocs.io/en/stable/

The same documentation is also available in this repository:

👉 docs/

Read the Docs provides a structured and navigable version of the same content.

Useful entry points:

The Problem

  • Laravel does not provide a native WebDAV server.
  • Many existing packages provide WebDAV clients, for example for Flysystem, but not a server.
  • Thin SabreDAV integrations often behave like black boxes inside Laravel.
  • Request flow, authentication, storage resolution, and routing are often difficult to inspect or influence.
  • Customization often requires replacing large parts of the integration.
  • Debugging is difficult because many WebDAV clients return generic errors or no useful diagnostics.
  • Client behavior differs noticeably between Windows Explorer, macOS Finder, and WinSCP.
  • Windows WebClient is especially strict about OPTIONS, PROPFIND, and response correctness.

This package integrates WebDAV cleanly into a modern Laravel architecture.

What This Package Provides

  • a WebDAV server for Laravel
  • an explicit request pipeline
  • Laravel Flysystem integration for storage
  • Laravel Gate / policy-based authorization by default
  • structured storage mapping through spaces
  • defined contracts and extension points instead of a black-box runtime
  • WebDavPath Facade for resolving WebDAV mount URLs and user storage paths from controllers, views, and jobs — without triggering the WebDAV pipeline
  • Laravel events for WebDAV mutations such as file and directory create, update, and delete
  • events are dispatched after successful operations, so applications can integrate cleanly without internal overrides or hooks
  • logging for authentication, routing, storage resolution, and server behavior
  • WebDAV behavior compatible with common clients, including Windows WebClient

Quickstart

docker compose up --build -d
docker compose exec php composer run serve

Default endpoint:

http://localhost:8000/webdav/default/

Seeded workbench credentials:

Username: testuser
Password: password

Quick verification:

curl -u testuser:password -X PROPFIND http://localhost:8000/webdav/default/

For full setup and configuration details, use the documentation links above.

Installation

composer require n3xt0r/laravel-webdav-server
php artisan vendor:publish --tag="laravel-webdav-server-config"
php artisan migrate

The package service provider is N3XT0R\LaravelWebdavServer\WebdavServerServiceProvider.

Core Concepts

  • Route shape: /webdav/{space}/{path?}
  • Authentication: HTTP Basic Auth
  • Storage mapping: configured spaces
  • Authorization: PathAuthorizationInterface, backed by Laravel Gate / policies by default

See Read the Docs for the complete request flow, configuration reference, and extension model.

WebDavPath Facade

Resolve WebDAV connection details for users without going through the WebDAV pipeline:

use N3XT0R\LaravelWebdavServer\Facades\WebDavPath;
use N3XT0R\LaravelWebdavServer\Contracts\Repositories\AccountRepositoryInterface;

// Mount URL — same for every user of a space
$url = WebDavPath::resolveUrl('default');
// → 'https://your-app.test/webdav/default'

// User-scoped storage path — pass the WebDAV account from the repository
$account = app(AccountRepositoryInterface::class)->findEnabledByUsername($username);
$path = WebDavPath::resolvePath($account, 'default');
// → 'webdav/42'

See Path Resolution for the full reference.

Compatibility Notes

  • The package implements WebDAV behavior compatible with common clients, including Windows WebClient.
  • Windows WebClient depends on correct OPTIONS handling, valid PROPFIND responses, valid 207 Multi-Status responses, root collection handling, and MS-Author-Via: DAV.
  • Prefer https://, especially for Windows clients.
  • Client-side constraints such as system configuration, local policy, and http:// versus https:// still apply.

Developer Commands

composer run test
composer run lint
composer run test:lint
composer run serve

License

MIT License

统计信息

  • 总下载量: 630
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固