Updated material invoice upload logic
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -741,10 +741,15 @@ class InvoiceValidationResource extends Resource
|
||||
FileUpload::make('invoice_material')
|
||||
->label('Invoice Material')
|
||||
->required()
|
||||
->acceptedFileTypes([
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
'application/vnd.ms-excel', // Legacy .xls fallback if needed
|
||||
])
|
||||
->rules(['mimes:xlsx']) // Laravel validation: extension check
|
||||
->preserveFilenames() // <- this keeps the original filename
|
||||
->reactive()
|
||||
->storeFiles(false) // prevent auto-storing
|
||||
->disk('local')
|
||||
->storeFiles(false) // prevent auto-storing, we will store manually
|
||||
->disk('local') // 'local' refers to the local storage disk defined in config/filesystems.php, typically pointing to storage/app.
|
||||
->visible(fn (Get $get) => ! empty($get('plant_id')))
|
||||
->directory(function (callable $get) {
|
||||
$plant = Plant::find($get('plant_id'));
|
||||
@@ -752,6 +757,7 @@ class InvoiceValidationResource extends Resource
|
||||
|
||||
return "uploads/temp/{$plantCode}";
|
||||
})
|
||||
->uploadingMessage('Uploading...')
|
||||
->helperText('Only .xlsx files are allowed (Excel files).'),
|
||||
])
|
||||
->action(function (array $data) {
|
||||
|
||||
Reference in New Issue
Block a user