KingsleyO's avatar

How to test scheduled tasks on localhost

I just set up task schedule to bump up a user's post to the top every minute for a week using this

 public function registerSchedule($schedule)
    {

        $start = Carbon::now();
        $end = $start->addDays(7);
        $schedule->call('Corymillz\Advert\Component\PaidBoost@onPaidBoost')->everyMinute()->between($start, $end);
    }

The function already been written. How can i test this on localhost? I am using xampp

0 likes
2 replies
tykus's avatar

You are re-evaluating $start every time you call this method - it will never not run.

In any case, you can run a cron locally using the settings specified in the docs

1 like
KingsleyO's avatar

Ok that explains why php artisan schedule:run was not working. Working now. Is there a way to make it run every hour for 7 days? Going by what i am trying to do up there

Please or to participate in this conversation.