I need to run certain commands after 2 days of another time that I read from database in laravel. I checked out the laravel's scheduler documentation but could not find anything related my problem.
How can I set up a scheduler relative to another time? I want to read a time/date from database and schedule a command based on this time. Also, It is not repetitive. It will only run once.
I think the best you can do is to setup a queued job. When you need to dispatch it (whenever it is in a scheduled task or not, it doesn't matter), you just dispatch it with a delay. It is well explained in the queue section of the documentation, right here: https://laravel.com/docs/5.7/queues#delayed-dispatching
In your case, you can dispatch the job using this Carbon instance as a delay: now()->addDays(2)
. Two days later, the job will be executed :)