Skip to content

Add Model beforeDelete property #902

@natanfelles

Description

@natanfelles

Well, I've read several debates about using or not using soft-deletes when to use this or not. And I found pertinent reasons in the "advocates" on either side.

So for several reasons, I decided to try not to use more soft-deletes and start having extra tables to archive the "deleted" data, if necessary... The biggest reason is that I use Foreign Keys and already perform automatic procedures through CASCADE and not by the PHP application as many suggest being "better" to control the stored data.

So I suggest to add the beforeDelete property to be able to do some action before deleting the data. Like, move them to an archive table, for example...

Since we already have beforeInsert and beforeUpdate in the Event Parameters I think that the existence of this property (and possibility of his triggered events) seems to be quite pertinent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions