2016-01-21 73 views
0

燦dailyAt()嵌套的方式使用,Laravel可以每天都嵌套嗎?

$schedule->command('foo') 
     ->dailyAt('00:01') 
     ->dailyAt('00:16'); 

或者它必須像,

$schedule->command('foo') 
     ->dailyAt('00:01'); 
$schedule->command('foo') 
     ->dailyAt('00:16'); 

回答

0

您可以使用手動cron表達式是這樣的:

$schedule->command('foo')->cron('0 9,17 * * *'); 

這已經在這個問題上得到解答:Laravel scheduler run twiceDaily at specific hours

+0

但是分鐘呢?就像我需要在00:01和00:16運行它。我需要兩個cron條目嗎? –

+1

在你的情況下,cron會是' - > cron('1,16 0 * * *');' –

+0

謝謝! @MarkDavidson –