このページの翻訳:
- 日本語 (ja)
- English (en)
最近の更新
- 14 Atom [折りたたみ]
- 2025.02.08 Redirects with # created
最近の更新
Laravelコマンドから引数が違う時などにヘルプを表示させたい。
下記のようにしておくと、指定の引数以外の時に対象コマンドのヘルプが表示されます。
$this→call('help',['command_name'⇒'コマンド名'])
protected $signature = 'command:TestCommand {arg : check 実行確認 | run 実行 }'; public function handle() { $arg = $this->argument("arg"); switch($arg){ case 'check': $this->test = 1; break; case 'run' : $this->test = 0; break; default: $this->call('help',['command_name'=>'command:TestCommand']); exit; } }