laravel特殊功能代码片段集合
console命令行交互
public function handle() { $name=$this->ask('What is your neme?'); $city=$this->choice('Where is your city?',[ 'Beijing','Shanghai','Wuhan' ]); $age=$this->secret('How old are you?'); if($this->confirm('output ok?')){ $this->table(['NAME','CITY','AGE'],[[$name,$city,$age]]); } }
应用代码中调用artisan
Artisan::call('command:test');
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。