14 Replies
Again: You didn't provide any information other than a screenshot.
that information is on title
"how to delete file on edit/delete?"
What file? Under which condition do you want to delete it?
We don't know anything about your code π€·ββοΈ
You expect us to know your system from a one liner.
i want to delete file too, not just a record
This is as helpful as if I respond: Files can be deleted via
Storage::delete()
Did you read that part of FileUpload docs?
i have done using
Storage::delete()
but still not deletedThen there is probably an issue, but I can't help you if you just say "I've done it"
the file won't be deleted
- Any error? Return value of the method?
- How does your
FileUpload
field look like?
- What the value of $record->image
?
- Where is your file stored?- The problem is that no error message appears,
delete success, but won't delete the file
- my file stored at
storage\app\public\car-kind-attachments\NLW7uwIITF5gUouMdCMFoeQ5LaO2jx-metaMjAyMzA3MDQwOTA5MDUucG5n-.png
- the value of $record->image
is car-kind-attachments/CMcvHeYyxlFxPMQZHlrYkwuQmUTKng-metaMjAyMzA3MDQwOTA5MDUucG5n-.png
- this is my FileUpload
code:
Forms\Components\FileUpload::make('image')->label('Image')->directory('car-kind-attachments')->image(),
Storage::disk('public')->delete($record->image)
okay, i'll try
this work for me, thankyou π
thankyou all @Dennis Koch @Vp