How can I prevent my FileUpload placeholder resetting

Here's my form with a fileupload component
public function fileUploadForm(Form $form): Form
{
return $form
->schema([
FileUpload::make('document')
->label('')
->maxSize($this->maxFileSize * 1024)
->multiple()
->disk('public')
->placeholder('this is my new placeholder')
->previewable(false),
]);
}
public function fileUploadForm(Form $form): Form
{
return $form
->schema([
FileUpload::make('document')
->label('')
->maxSize($this->maxFileSize * 1024)
->multiple()
->disk('public')
->placeholder('this is my new placeholder')
->previewable(false),
]);
}
And here's my method that gets called whenever a file is uploaded:
public function updatedDocument(): void
{
$document = Arr::last($this->document);
$documentPath = $this->storeDocument($document);

$data = [
'name'=>$document->title,
'path' => $documentPath,
];
$this->application->supportingDocuments()->create($data);
}
public function updatedDocument(): void
{
$document = Arr::last($this->document);
$documentPath = $this->storeDocument($document);

$data = [
'name'=>$document->title,
'path' => $documentPath,
];
$this->application->supportingDocuments()->create($data);
}
But for some reason the placeholder reverts to the default "Drag and drop your files or browse" message whenever a file gets uploaded. How can I stop this?
0 Replies
No replies yetBe the first to reply to this messageJoin