update migrasi upload file to s3 amazon
This commit is contained in:
@@ -350,15 +350,16 @@ class InvoicePaymentController extends Controller
|
||||
}
|
||||
if (!empty($valuePayments['files']) && is_array($valuePayments['files'])) {
|
||||
foreach ($valuePayments['files'] as $file) {
|
||||
$pathFile = File::storeFile('files-proof-payment', $lastInsertedId, $file);
|
||||
$fileData = File::storeFile('files-proof-payment', $lastInsertedId, $file);
|
||||
File::updateOrCreate([
|
||||
'fileable_type' => 'App\Models\InvoicePayment',
|
||||
'fileable_id' => $lastInsertedId,
|
||||
'type' => 'files-proof-payment',
|
||||
'name' => File::getFileName('files-proof-payment', $lastInsertedId, $file),
|
||||
'name' => $fileData['name'],
|
||||
'original_name' => $file->getClientOriginalName(),
|
||||
'extension' => $file->getClientOriginalExtension(),
|
||||
'path' => $pathFile,
|
||||
'source' => env('FILESYSTEM_DISK'),
|
||||
'path' => $fileData['path'],
|
||||
'created_by' => auth()->user()->id,
|
||||
'updated_by' => auth()->user()->id,
|
||||
]);
|
||||
@@ -444,15 +445,16 @@ class InvoicePaymentController extends Controller
|
||||
//File New
|
||||
if (!empty($valuePayments['files']) && is_array($valuePayments['files'])) {
|
||||
foreach ($valuePayments['files'] as $file) {
|
||||
$pathFile = File::storeFile('files-proof-payment', $invoicePaymentId, $file);
|
||||
$fileData = File::storeFile('files-proof-payment', $invoicePaymentId, $file);
|
||||
File::updateOrCreate([
|
||||
'fileable_type' => 'App\Models\InvoicePayment',
|
||||
'fileable_id' => $invoicePaymentId,
|
||||
'type' => 'files-proof-payment',
|
||||
'name' => File::getFileName('files-proof-payment', $invoicePaymentId, $file),
|
||||
'name' => $fileData['name'],
|
||||
'original_name' => $file->getClientOriginalName(),
|
||||
'extension' => $file->getClientOriginalExtension(),
|
||||
'path' => $pathFile,
|
||||
'source' => env('FILESYSTEM_DISK'),
|
||||
'path' => $fileData['path'],
|
||||
'created_by' => auth()->user()->id,
|
||||
'updated_by' => auth()->user()->id,
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user