Dhana Balan
Dhana Balan

Reputation: 41

Schedule multiple cron jobs in same time in laravel

I have two different cron jobs below.

protected function schedule(Schedule $schedule)
{
    $schedule->command('eventnotification:mail');
    $schedule->command('workflownotification:mail');
}

How can I run both cron jobs by daily 6:00AM?

Upvotes: 0

Views: 1657

Answers (1)

thisiskelvin
thisiskelvin

Reputation: 4202

You can run schedules daily at a certain time using the dailyAt() function:

protected function schedule(Schedule $schedule)
{
    $schedule->command('eventnotification:mail')->dailyAt('6:00');
    $schedule->command('workflownotification:mail')->dailyAt('6:00');
}

Upvotes: 1

Related Questions