F
Filament5mo ago
Anish

Delete exported file

Is there a way to remove the exported files and the relevant database entry for an exporter?
6 Replies
dhanar98
dhanar985mo ago
hi @Anish importing a file or exporting a file in application ? hi @Anish for the above question my answer is if you are importing the file to store records create a log for the uploaded file e.x table : upload_file id file_name extension created_at,updated_at need column based on your requirement add the foriengn key id for upload_file_id in the table based on the upload file deletion cascade the data this is what i'm doing my application if the imported records make any issues.
Anish
Anish5mo ago
Exported to csv, downloaded it and cleared from the notification. Now I have no way to access the file from the interface and I don't need it anymore. I would like the file to be removed.
dhanar98
dhanar985mo ago
write the unlink function for your file
Anish
Anish5mo ago
After checking the documentation, I found that there is a model
Filament\Actions\Exports\Models\Export;
Filament\Actions\Exports\Models\Export;
which holds the information about the export. One can define a hasMany relation on the User model to get the exports done by the User. What I now need if there is any event that is dispatched when one clears the notifications. Then I can write a listener which will delete the file and also the corresponding database entry. I think this may be a Laravel Event, so I need to dig up the details on clearing database notifications.
Zen
Zen4mo ago
Is there any good answer for this?
Zen
Zen4mo ago
I deleted old one, then created new one.
No description