Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zaster's avatar

Soft Delete on All My Models

I have decided to enable soft deletes on all my models. Are there any negative impacts on doing so ?

0 likes
3 replies
khaledw62's avatar

no nothing you just need to use the SoftDeletes Trait in all your models and adding the deleted_at column to all of your model's table

1 like
CorvS's avatar

Aside from "unused" data inside your database you could be blocking unique columns like emails, user names or slugs for example. Additionally you should ask yourself if it really makes sense to soft delete all models and keep in mind that some data has to be deleted if the user wishes so. Ask yourself in general if you really need that data in the future.

1 like

Please or to participate in this conversation.