mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-24 06:54:02 +00:00
Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development
This commit is contained in:
@@ -72,13 +72,13 @@ class ExcelHandel
|
||||
if($filesystemDriver === 's3'){
|
||||
$filePathForS3 = 'public/excels/' . $path . '/' . $filename . '.' . $extension;
|
||||
Storage::disk('s3')->put($filePathForS3, $exceldata);
|
||||
$file_info['original']['file'] = Storage::disk('s3')->path($filePathForS3);
|
||||
}
|
||||
else{
|
||||
$file = Storage::disk('public')->put('excels/' . $path . '/' . $filename . '.' . $extension, $exceldata);
|
||||
$file_info['original']['file'] = storage_path('app/public/excels/' . $path . '/' . $filename . '.' . $extension);
|
||||
}
|
||||
|
||||
$file_info['original']['file'] = storage_path('app/public/excels/' . $path . '/' . $filename . '.' . $extension);
|
||||
|
||||
return $file_info;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Str;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Maatwebsite\Excel\Excel as ExcelFileTypes;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ImportUpdateDebtorController
|
||||
{
|
||||
@@ -23,7 +24,18 @@ class ImportUpdateDebtorController
|
||||
*/
|
||||
public function import(Request $request) {
|
||||
$object = new DocumentObject('', $request->input('files'), '', ApprovalStatus::APPROVED, 'imports');
|
||||
Excel::import(new ImportsDebtor(), json_decode($object->getFiles()[0])->file_info->original->file);
|
||||
$file = json_decode($object->getFiles()[0])->file_info->original->file;
|
||||
|
||||
$filesystemDriver = Storage::getDefaultDriver();
|
||||
if($filesystemDriver === 's3'){
|
||||
$file = Storage::disk('s3')->path('documents/' . $file);
|
||||
}
|
||||
//Shipping Portal requires the following (NOT TESTED)
|
||||
// else{
|
||||
// $file = 'documents/' . $file;
|
||||
// }
|
||||
|
||||
Excel::import(new ImportsDebtor(), $file);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user