Support the ongoing development of Laravel.io →
Database Eloquent Architecture
Last updated 2 years ago.
0

the SO article suggests you have 2 tables and create a relationship between (lookup Eloqunt Relationships in the docs)

I think it's better, like somebody suggests on SO, to keep everything in one table. The flow will be like

  • user creates new article, type = draft

  • admin presses publish, type changed to published

  • user edits existing article with type published and when the user presses save a new article is created with type = draft and parent_id to the id of the original article

  • admin presses publish, the original article is updated with the data from the draft and the draft is discarded

something like that

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

tougher tougher Joined 27 Mar 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.