如何在 laravel 中将计划任务作业放入链中?

how to put schedule task jobs in chain in laravel?

我在其中使用 laravel 任务调度队列作业或工作 我想将这些作业放入链中 kernel.php

    $schedule->job(new \App\Jobs\FetchEmailAttachment)->dailyAt('16:15')->timezone('Australia/Melbourne');
    $schedule->job(new \App\Jobs\UploadFileFTP)->dailyAt('16:15')->timezone('Australia/Melbourne');
    $schedule->job(new \App\Jobs\SplitAttachment)->dailyAt('16:15')->timezone('Australia/Melbourne');           
    $schedule->job(new \App\Jobs\ResendAttachment)->dailyAt('16:15')->timezone('Australia/Melbourne');

我尝试使用 laravel withChain 方法,但它不起作用。

我想运行链中的这些作业

使用 call 闭包,向 $schedule 添加新的回调,然后使用 withChain 调度链式作业,从第一个开始:

 $schedule->call(function(){
           \App\Jobs\FetchEmailAttachment::withChain([
                new \App\Jobs\UploadFileFTP,
                new \App\Jobs\SplitAttachment,
                new \App\Jobs\ResendAttachment,             
            ])->dispatch();
 })
 ->dailyAt('16:15')
 ->timezone('Australia/Melbourne');