protected function processRuntime($server)
    {
        $filename = $this->option('filename') ?? storage_path('framework/server.runtime');

        $server->registerEventCallback('Launching', function () use ($filename) {
            $this->saveRuntime($filename);
        });

        $server->registerEventCallback('Start', function () {
            $this->info("{$this->laravel->name()} server is running.");
        });

        $server->registerEventCallback('Shutdown', function () use ($filename) {
            $this->removeRuntime($filename);

            $this->info("{$this->laravel->name()} server is stopped.");
        });
    }