I've been thinking about this for weeks now and can't seem to get a possible solution on how to implement a publishing feature? like in a wordpress page you need to publish the page so the changes will be reflected in the live website? How do you normally do this kind of functionality? I'm just confused because if I change the data in the database then it will affect the live site even though i'm still editing the page. Any tutorial or resources would be very dope. Thank you guys, Have a great day.
Asked
Active
Viewed 248 times
-2
-
You can use two branches **DEV** and **MASTER** or **PROD** each branche has a specific configuration in the `.ENV` file with a specific database if you want publish some chages that you did in the dev brache all you can do is merge it to the master branche and deploy it in the prod server and also you can use migrations to update the schema of the database !! – Maraboc Jul 31 '17 at 13:29
-
I don't really understand what exactly you want to accomplish! but for the resources I think laracasts.com would be good for that. but you can use blade template to render data on how you want it and where you want it. you need to show example of what you want to accomplish. and we will be happy to assist you. – madeny Jul 31 '17 at 13:30
-
Stackoverflow is not a site for this kind of questions. – Philipp Sander Jul 31 '17 at 13:30
-
@PhilippSander i'm posting to laracast RN. thank you. – Keannu Alforque Atilano Jul 31 '17 at 13:36
-
@Maraboc I think Rudolfs answer is much easier and managable for debugging. – Keannu Alforque Atilano Jul 31 '17 at 13:37
-
Are you asking how to implement a "conditional showing of content", where you have a boolean "published" (or better timestamp "published_at") and simply show content if that variable is true? I really do not understand the question. – Kyslik Jul 31 '17 at 19:28
1 Answers
1
I don't have any tutorials or resources to give, but my advice is separating types of content you use. For example, when you are editing something, make sure it's type is set to "draft" or something like that. When you publish, just create a copy of draft with a type of "published".
Yes, you will have duplicated data in the database, but when showing content on page, you won't see it.
I am afraid there is no other way to do it, except maybe having one model have additional fields, which are meant for just editing and when published, their values get assigned to the main object variables.

Rudolfs Heimanis
- 37
- 2