📜  laravel 包控制台命令 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:42.388000             🧑  作者: Mango

代码示例3
public function boot()
    {
        
        if ($this->app->runningInConsole()) {
            
            $this->commands([
                PackageCommandClassNameHere::class,
            ]);

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