Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Model beforeDelete property #902

Closed
natanfelles opened this issue Jan 14, 2018 · 1 comment
Closed

Add Model beforeDelete property #902

natanfelles opened this issue Jan 14, 2018 · 1 comment

Comments

@natanfelles
Copy link
Contributor

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.

@lonnieezell
Copy link
Member

I have no problem with that event being added to the model.

lonnieezell added a commit that referenced this issue Jan 16, 2018
Add Model beforeDelete Event - closes #902
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants