参考: https://tutsforweb.com/how-to-set-up-task-scheduling-cron-job-in-laravel/
中文资料有很多,但是发现都不太可行,最后参考上文完成
一. 创建文件:WordOfTheDay.php, in the app/Console/Commands directory.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class WordOfTheDay extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'command:name';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.