Invoice PAIN & CSV can be uploaded
This commit is contained in:
27
app/Providers/WebDavProvider.php
Normal file
27
app/Providers/WebDavProvider.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
use WebDav\WebDav\WebDavClient;
|
||||
class WebDavProvider {
|
||||
public const INVOICE_PREFIX = 'Abrechnungen ';
|
||||
|
||||
private WebDavClient $webDavClient;
|
||||
private string $workingDirectory = '/';
|
||||
|
||||
public function __construct($workingDirectory) {
|
||||
$this->webDavClient = new WebDavClient(env('WEBDAV_HOST'), env('WEBDAV_USER'), env('WEBDAV_PASS'));
|
||||
$this->workingDirectory = $workingDirectory;
|
||||
}
|
||||
|
||||
public function uploadFile(string $fileName) {
|
||||
$baseDir = storage_path('app/private/');
|
||||
|
||||
$this->webDavClient->upload_file($baseDir . $fileName, $this->workingDirectory . '/'.
|
||||
basename($fileName)
|
||||
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user