Just have something like a 'golive' datetime field on the table and depending how your code works either use that as a filter on the returned results or a scheduled task that runs every so often and checks the date and sets a 'is_live' flag? Whatever works in your situation really :-)
What's the proper way to handle scheduled blog posts?
Laravel's Queue::later() should only be used with short amounts of time in my opinion, something like minutes or a few hours.
But when a user of my app wants to schedule something for next month, or even next year, how should I handle it?
I was thinking of making a schedules table and add the scheduled posts there, and have a cronjob running every minute. But what should my cronjob actually do?
Also, would this be the best way of handling this, or there's something in Laravel for this kind of task that I'm not aware of?
Thanks
Edit: I forgot to mention, when a blog post goes like, I have to trigger some commands like posting to Twitter and Facebook, or send an email to the user to let them know that the post has been posted.
Please or to participate in this conversation.