在shell中使用php artisan 可以查看所有的命令
配置自己创建的artisan console 流程如下:”
1 使用artisan 创建命令文件
php artisan make:command TestCreate
生成的文件会在 app\command 路径下,需要修改下面两个地方
/**
* The name and signature of the console command.
*调用list显示命令的时候会被用到
* @var string
*/
protected $signature = 'test:create{--file=} {--paging}';
这里输入test:create 在命令行中就用 php artisan test:create 来调用这个命名文件
/**
* The console command description.
*调用list显示命令的时候会被用到
* @var string
*/
protected $description = "生成回流文件!";
/**
* Execute the console command.
*在命令执行时被调用
* @return mixed
*/
public function handle()
{
}
最后还需要在app/Console/kernel.php中的command数组中载入你创建的command