Delete image file when deleting avatar?
Closed this issue · 2 comments
The avatar component is great!
When configured as instructed via ->avatarUploadComponent(fn($fileUpload) => $fileUpload->disableLabel())
, the avatar pictures are uploaded to app/storage/public
by default, which is not good enough for managing resource files. How to store them in a folder, say app/storage/public/avatars
?
OK, I've figured it out.
Now the question is whether it is possible to delete the uploaded image file when clicking the delete avatar button?
@DrewNeon look in \Filament\Forms\Components\BaseFileUpload for the deleteUploadedFileUsing
method. You can pass a callback to handle file deletion. If you search the Discord channel for this method, there are a few examples from others who have accomplished the same.
Closing this issue because it is related to Form Builder and not Breezy.