【发布时间】:2019-05-02 13:56:23
【问题描述】:
假设我正在编写一个命令。我如何在它运行的过程中完全停止它?
例子:
public function handle()
{
if (!$this->good_times) {
$this->error('Bad times');
$this->exit();
}
// continue command stuff
}
我试过了:
throw new RuntimeException('Bad times');
但这会在终端中倾倒一堆丑陋的东西。
【问题讨论】:
标签: php laravel laravel-5 command