Configuration¶
All package configuration is loaded from config/webdav-server.php and accessed through the webdav-server.* key.
Most Important Settings¶
Start with these keys in most integrations:
webdav-server.base_urifor the SabreDAV base URIwebdav-server.storage.default_spacefor the fallback space keywebdav-server.storage.spaces.{space}.diskand.rootfor storage routingwebdav-server.auth.account_modelfor the WebDAV account storewebdav-server.auth.user_modelif policies should receive a linked Laravel userwebdav-server.logging.driverand.levelfor package and SabreDAV logging
For SabreDAV runtime extensions and tagged plugins, see Server Customization.
Published Config Stub¶
The published configuration currently looks like this:
use N3XT0R\LaravelWebdavServer\Models\WebDavAccountModel;
return [
'route_prefix' => 'webdav',
'base_uri' => '/webdav/',
'browser_listing' => false,
'logging' => [
'driver' => null,
'level' => 'info',
],
'storage' => [
'default_space' => 'default',
'spaces' => [
'default' => [
'disk' => 'local',
'root' => 'webdav',
'prefix' => '/',
],
],
],
'auth' => [
'account_model' => WebDavAccountModel::class,
'user_model' => null,
'username_column' => 'username',
'password_column' => 'password_encrypted',
'enabled_column' => 'enabled',
'user_id_column' => 'user_id',
'display_name_column' => 'display_name',
],
];
Top-Level Keys¶
| Key | Default | Used by |
|---|---|---|
webdav-server.route_prefix |
webdav |
CSRF exclusion registration in WebdavServerServiceProvider |
webdav-server.base_uri |
/webdav/ |
SabreDAV base URI in SabreServerConfigurator |
webdav-server.browser_listing |
false |
Enables SabreDAV Browser\Plugin |
webdav-server.logging.driver |
null |
Package logging and SabreDAV logger wiring |
webdav-server.logging.level |
info |
Minimum package log level |
Route Prefix And Base URI¶
These two settings affect different parts of the runtime.
route_prefixis used for CSRF exclusion registration- if
route_prefixis empty, CSRF exclusion falls back tobase_uri base_uriis used bySabreServerConfiguratorto build the effective SabreDAV base URI for the resolved space
The package route itself is currently registered from routes/web.php as:
/webdav/{space}/{path?}
That route shape is not derived dynamically from route_prefix or base_uri.
With the default configuration and the default space key, the effective SabreDAV base URI becomes:
/webdav/default/
Browser Listing¶
When browser_listing is set to true, the SabreDAV Browser\Plugin is attached to the runtime. This renders an
HTML directory listing when a WebDAV space is accessed from a browser.
'browser_listing' => true,
The browser plugin is disabled by default because it exposes the directory tree to any authenticated HTTP client without any additional access control beyond the package's existing path authorization.
When the browser listing is active, SabreDAV renders two HTML forms on every directory page:
- Create folder - submits a
POSTrequest that SabreDAV converts to aMKCOLoperation internally - Upload file - submits a
POSTrequest that SabreDAV converts to aPUToperation internally
Both forms work out of the box. The package route accepts POST for this purpose, and the WebDAV endpoint is
automatically excluded from Laravel's CSRF middleware so browser submissions are not rejected.
Note
Enable this in development or internal environments only. Do not enable it in production unless path authorization is explicitly configured to restrict access.
Logging¶
Package logging is configured under webdav-server.logging.
Relevant keys:
webdav-server.logging.driverwebdav-server.logging.level
Behavior:
- if
driverisnull, package logging is disabled entirely - if
drivercontains a Laravel log channel name such asstack,single, orstderr, package logs are written to that channel leveldefines the minimum package log level that will be emitted- the same logger is also attached to SabreDAV via
SabreServerConfigurator
Typical usage:
- use
infoto record operational events such as authentication success or failure - use
debugduring development to trace credential extraction, request-context resolution, storage resolution, authorization checks, server setup, and Windows-relevant DAV handling
Storage Spaces¶
DefaultSpaceResolver reads webdav-server.storage.spaces and resolves a logical space key to one effective storage
target.
Relevant keys:
webdav-server.storage.default_space(default:default)webdav-server.storage.spaces.{space}.disk(required)webdav-server.storage.spaces.{space}.root(required)webdav-server.storage.spaces.{space}.prefix(optional)
RequestSpaceKeyResolver determines the spaceKey in this order:
- route parameter
{space} - fallback
webdav-server.storage.default_space
The resolved runtime root always appends the authenticated principal ID.
If prefix is missing, empty, or exactly /, the effective root becomes:
{root}/{principal.id}
If prefix is a non-empty path segment, the effective root becomes:
{root}/{prefix}/{principal.id}
Example:
disk = localroot = webdavprefix = uploadsprincipal.id = 42- effective root path:
webdav/uploads/42
Path Resolution¶
PathResolverService is the single authoritative location for the path assembly formula. DefaultSpaceResolver
delegates to it internally. The WebDavPath Facade exposes both resolvePath() and resolveUrl() for use in
controllers, views, and background jobs.
See Path Resolution for the full reference including Facade usage, the path formula, and how
to replace PathResolverInterface.
Auth Mapping¶
EloquentAccountRepository reads the account model and its column mapping from webdav-server.auth.
Relevant keys:
webdav-server.auth.account_modelwebdav-server.auth.user_modelwebdav-server.auth.username_columnwebdav-server.auth.password_columnwebdav-server.auth.enabled_columnwebdav-server.auth.user_id_columnwebdav-server.auth.display_name_column
Current defaults:
account_modeldefaults to the package modelN3XT0R\LaravelWebdavServer\Models\WebDavAccountModeluser_modeldefaults tonullusername_columndefaults tousernamepassword_columndefaults topassword_encryptedenabled_columndefaults toenableduser_id_columndefaults touser_iddisplay_name_columndefaults todisplay_name
Behavior notes:
account_modelmust be an Eloquent model classuser_modelis required if your policies should operate on$principal->userenabled_column,user_id_column, anddisplay_name_columnare treated as optional mappings- setting one of those optional column mappings to
nullor an empty string disables that mapping
Failure Modes¶
Invalid auth and storage configuration raises domain-specific package exceptions instead of generic runtime exceptions.
Examples:
InvalidAccountConfigurationExceptionMissingUserModelConfigurationExceptionSpaceNotConfiguredExceptionInvalidSpaceConfigurationExceptionInvalidDefaultSpaceConfigurationException
Notes¶
- The package registers the WebDAV route shape
/webdav/{space}/{path?}. route_prefixis used for CSRF exclusion and falls back tobase_uriwhen empty.base_uriis used to build the effective SabreDAV base URI together with the resolvedspaceKey.logging.driver = nulldisables all package and SabreDAV logging.storage.spaces.*is the active storage configuration model.prefix = '/'behaves like no extra prefix segment.- The package service provider registers
Gate::policy(PathResourceDto::class, PathPolicy::class)by default.