我一直在追踪
http://laravel.com/docs/5.0/commands,并能够在Laravel 5中创建手工指令.但是,如何创建手工指令并将其打包到包中?
您可以使用register()方法中的$this-> commands()在服务提供者内注册包命令:
原文链接:https://www.f2er.com/laravel/132609.htmlnamespace Vendor\Package; class MyServiceProvider extends ServiceProvider { protected $commands = [ 'Vendor\Package\Commands\MyCommand','Vendor\Package\Commands\FooCommand','Vendor\Package\Commands\BarCommand',]; public function register(){ $this->commands($this->commands); } }