mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-22 14:04:01 +00:00
Laravel Vapor - Fix path to upload documents to S3 bucket with dynamic path
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Classes\Modules\Documents\DataTransferObjects;
|
||||
|
||||
use App\Classes\General\Interfaces\DataTransferObject;
|
||||
use App\Classes\Modules\Documents\Services\ConvertsBase64ToFile;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class DocumentObject implements DataTransferObject
|
||||
{
|
||||
@@ -72,9 +73,14 @@ class DocumentObject implements DataTransferObject
|
||||
*/
|
||||
public function getFiles(): array
|
||||
{
|
||||
return (new ConvertsBase64ToFile($this->path))->convert($this->files);
|
||||
$filePath = $this->path;
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
if($filesystemDriver == 's3'){
|
||||
$filePath = 'documents/'.$this->path;
|
||||
}
|
||||
return (new ConvertsBase64ToFile($filePath))->convert($this->files);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user