S
S
Sergey Gutovsky2018-06-18 00:49:03
Laravel
Sergey Gutovsky, 2018-06-18 00:49:03

How to search the database for "overdue" tasks?

I am using Laravel. In the database there is a table with tasks. When creating a task, the user indicates to him the deadline for completion (deadline). So, you need to check for the expiration of these tasks in the database, and if there are any, update some fields. When and where should this be done? The user, when entering the page, should receive already updated tasks. I implemented this through middleware, before the controllers start working, it finds overdue tasks and updates them.
I'm not sure if this is the right thing to do, as there are a lot of features (queue, serviceproviders) that might be better for this. In addition, when a user enters his page, only his tasks are updated. And if I create an admin panel with a full table, will I have to create a new middleware?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ranwise, 2018-06-18
@GutOf

I think you can’t do without cron, make a selection of who has an overdue time every 30-60 minutes and fill in the fields

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question