diff --git a/HotReload.php b/HotReload.php index b2cbc47..3fd75f4 100644 --- a/HotReload.php +++ b/HotReload.php @@ -39,6 +39,9 @@ class HotReload extends Command { $this->setName('hot:load'); parent::configure(); // TODO: Change the autogenerated stub + + Process::signal(SIGINT, fn() => $this->exit()); + Process::signal(SIGTERM, fn() => $this->exit()); } @@ -64,6 +67,16 @@ class HotReload extends Command } + /** + * @return void + * @throws Exception + */ + public function exit(): void + { + $this->stopProcess(); + } + + /** * @return void */