F
Filament6mo ago
Fossil

Custom delete logic?

My app requires some files on disk to be delete when a model is deleted. I have a function in the model that handles this plus the row deletion in DB itself. Any way I could make the delete and bulk delete functions in Filament call this code instead of just removing the record from the DB?
1 Reply
Fossil
Fossil6mo ago
Can I do this?
DeleteAction::make()->action(function () {
DeleteAction::make()->action(function () {
Seems to work.
DeleteAction::make()->action(function ($record) {
// Bla
}
DeleteAction::make()->action(function ($record) {
// Bla
}