ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
在laravel5.3中增加了console.php这个路由文件 ~~~ Artisan::command('inspire', function () { $this->comment(Inspiring::quote()); })->describe('Display an inspiring quote'); ~~~ 在command中打php artisan inspire会输出名言警句 就是我们一些命令不用生成artisan命令了 **自定义命令** ~~~ Artisan::command('hello {name}', function () { $this->comment('Hey!' . $this->argument('name')); })->describe('say hello'); ~~~ 上面我们定义了一个参数name,如果参数name要增加注释的话可以 ~~~ Artisan::command('hello {name : 一个人的名字}', function () { $this->comment('Hey!' . $this->argument('name')); })->describe('say hello'); ~~~ 这样就可以用php artisan help hello看到了