laravel学习之路4artisan
php artisan list
php artisan help migrate
Tinker 让你可以在命令行中与 Laravel 应用进行交互php artisan tinker
在routes/console.php里面可以加闭包命令
Artisan::command('build {project}', function ($project) {
$this->info("Building {$project}!");
})->describe('Build the project, yeah');
php artisan build elesos
参数及选项都包在大括号中
不接收值的选项,当在命令中写出时,值为true,不写表示false
注册app/Console/Kernel.php
protected $commands = [ Commands\SendEmails::class ];
Route::get('/foo', function () { $exitCode = Artisan::call('email:send', [ 'user' => 1, '--queue' => 'default' ]); // });
还可以命令中调用其它命令
时间宝贵,只能复制+粘贴,若图片无法显示或排版混乱,请访问https://elesos.github.io查找原文

浙公网安备 33010602011771号