I have a package that contains Artisan commands. I’ve registered these commands with Artisan via my service provider like so:
/**
* Register the application services.
*
* @return void
*/
public function register()
{
// Register Amazon Artisan commands
$this->commands([
'App\Marketplace\Amazon\Console\PostProductData',
'App\Marketplace\Amazon\Console\PostProductImages',
'App\Marketplace\Amazon\Console\PostProductInventory',
'App\Marketplace\Amazon\Console\PostProductPricing',
]);
}
但是,这些命令需要安排为每天运行.
I know in app/Console/Kernel.php there is the schedule()
method where you can register commands and their frequency, but how can I schedule commands in my package’s service provider instead?