PHP code example of n3xt0r / laravel-webdav-server

1. Go to this page and download the library: Download n3xt0r/laravel-webdav-server library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

n3xt0r / laravel-webdav-server example snippets


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'