ivandoric / Making-Websites-With-October-CMS

This is a repository for video tutorial series about making websites with October CMS. You can check out the series here: https://goo.gl/eW32CM
160 stars 52 forks source link

I want the system check the end_membership_date and current date #30

Closed FarzinBidokhti closed 5 years ago

FarzinBidokhti commented 5 years ago

Hi I have user in my system. The users have start_membership_date, end_membership_date and status fields. I want the system check the end_membership_date and current date, if current date is bigger than end_membership_date the status update to 0. what am i doing? what's your solution? My friend suggestion to me i write my code in boot function. (edited)

ivandoric commented 5 years ago

Hmmm. I'm not a backend developer, so I don't run much into those kind of problems. However, I think that the "standard" solution is to use your servers Cron jobs for something like this.

So for example, this type of code should be run every day at 00:01.

Now by digging a bit it turns out that October has some sort of Task scheduling system. So maybe take a look at that: https://octobercms.com/docs/plugin/scheduling

FarzinBidokhti commented 5 years ago

Thanks.