在扩展包的Serviceprovider的boot方法上添加即可:

public function boot()
{
    $this->app->booted(function () {
        $schedule = $this->app->make(Schedule::class);
        $schedule->command('command')->weekly();
    });
}

results matching ""

    No results matching ""