filament/forms
v3.2.106
v10.48.20
v3.5.6
PHP 8.3.10
When using the FileUpload field, there is inconsistent behaviour in when certain callbacks are triggered in regards to removing a file.
afterStateUpdated()
is called (on a create and edit form)removeUploadedFile()
is called directly by the pagedeleteUploadedFile()
is called, which calls removeUploadedFile()
and a callback deleteUploadedFileUsing()
afterwardsA way to consistently trigger code after a user decided to remove an uploaded file which is not persisted by submitting the form.
Forms\Components\FileUpload::make('files')
->multiple()
->afterStateUpdated(static function (array $state): void {
// triggered after every upload
})
->deleteUploadedFileUsing(static function (array $state, $file): void {
// triggered only after a file that is persisted (eg. on edit form) is removed
}),
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too