where to put afterDelete()
I have a resurce that also have a fileupload.
when deleting the resource, I would like to delete the file as well.
I can see that there is a afterDelete hook, but I cannot figure out where to implement my logic
I have tried in the List and EditRecord page, but it does not get called.
Is there a better way to do this ?
4 Replies
Strange, I believe it should work on the Edit page...
Have you tried a model observer?
https://laravel.com/docs/10.x/eloquent#observers
i would do this in a model observer too
Ok, Observer it is, but... when is afterDelete called and used for then ?
try
DeleteAction::make()->after(fn () => dd('test'))