Max height on FileUpload or modal?

Is there a way to enforce a max height of either the file upload field, or the modal itself? See image for context.
No description
1 Reply
Helge Sverre
Helge SverreOP11mo ago
Code:
Actions\Action::make('upload')
->label('Last opp lønnslipp')
->form(form: [

FileUpload::make('files')
->imagePreviewHeight('40px')
->multiple()
->acceptedFileTypes(['application/pdf'])
->directory('payslips')
->storeFileNamesIn('original_file_names')
->getUploadedFileNameForStorageUsing(
fn (TemporaryUploadedFile $file) => sprintf('file_%s.%s', Str::random(), $file->getClientOriginalExtension())
)
->columnSpanFull(),
])
->modalSubmitActionLabel('Opprett')
->action(function ($data) {

foreach ($data['files'] as $file) {

$payslip = Payslip::create([
'user_id' => Auth::id(),
'path' => $file,
'size' => rescue(fn () => Storage::size($file), report: false),
'mime' => Storage::mimeType($file) ?: null,
'filename' => $data['original_file_names'][$file] ?? null,
]);

ScanPayslip::dispatch($payslip);
}

}),
Actions\Action::make('upload')
->label('Last opp lønnslipp')
->form(form: [

FileUpload::make('files')
->imagePreviewHeight('40px')
->multiple()
->acceptedFileTypes(['application/pdf'])
->directory('payslips')
->storeFileNamesIn('original_file_names')
->getUploadedFileNameForStorageUsing(
fn (TemporaryUploadedFile $file) => sprintf('file_%s.%s', Str::random(), $file->getClientOriginalExtension())
)
->columnSpanFull(),
])
->modalSubmitActionLabel('Opprett')
->action(function ($data) {

foreach ($data['files'] as $file) {

$payslip = Payslip::create([
'user_id' => Auth::id(),
'path' => $file,
'size' => rescue(fn () => Storage::size($file), report: false),
'mime' => Storage::mimeType($file) ?: null,
'filename' => $data['original_file_names'][$file] ?? null,
]);

ScanPayslip::dispatch($payslip);
}

}),
Want results from more Discord servers?
Add your server