User with many relationships, loop within Job class
Hey all,
I have a bunch of users that will all have or may not have have a tenancy (rental on a property) and is a belongsTo relationship.
So my question is, I've created a job that I need to check every day if they have a tenancy or not, then after 21 days it should fire of an email to admin user.
Then just build up your email(s) to admin based on the result(s) and queue it/them.
It really depends on how you store everything. You might just be able to use a has() on the belongsTo relationship and where last tenancy date is 21 days in the past.
My post did nothing to help with your original question, it only helped you debug an unrelated issue. Please mark an accepted answer based on the topic of this thread so people who land here after searching for a related problem aren't confused.