下面介绍一个Laravel任务调度使用实例,至于相关的方法请参考:http://laravelacademy.org/post/8484.html
1. make:command 生成任务
php artisan make:command MigrateData
执行上述命令后,会在Console目录新建一个Commands目录,里面有个MigrateData.php文件
2. 编写任务
在MigrateData.php的handle方法中编写要处理的逻辑,下面附上内容
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class MigrateData extends Command
{
/**
* The name and signature of the cons