Answer the question
In order to leave comments, you need to log in
How to check in the database in the background?
Good afternoon, on the site I am doing the Subscription function, that is, the account is given 1 month of free use. Where, in what place of the project you need to register a trigger or a function that will always compare data and turn off those that have expired (Now this is done only after a person logs into the account)
Answer the question
In order to leave comments, you need to log in
Add a field to the user where to store the last subscription date.
class User {
public function isSubscriptionWorks() {
return $this->subscibed_at > strtotime('1 month ago');
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question