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

Amalmax's avatar

How to keep backups data in Laravel?

Hello, In My Larvel 5.6 app I have table name called "projects". with following columns name

id   projectname    data      user     type   crated_at   updated_at

but I have schedule on projects table to delete every project rows after created two weeks.

Now I need generate some reports about past three months using projects table. My problem is this according to my system every projects are deleting after created two weeks then what is the methods to generate past three months reports using projects table values?

0 likes
3 replies
Snapey's avatar

you could use soft deletes and only mark the project as deleted, then use withTrashed when running the report.

Obviously you cannot report on the months already deleted

Amalmax's avatar

@Snapey what did you mean by you could use soft deletes and only mark the project as deleted, then use withTrashed when running the report.

Please or to participate in this conversation.