Checking site status after deploying with Laravel's Envoy

At MonitorBase we've started using Laravel's Envoy to deploy our new inhouse invoice system.

For us, our invoice system is hosted on a basic AWS set up on a single server. I'll be publishing more on our deployment process but it is a little complex due to our security protocols.

After the deployment, we wanted to know if the invoice system was live and returning a 200 as it should.

(Here's our dumbed-down code with the health check to return a 200)

    $healthUrl = '';

@servers(['server' => ''])


@task('deployCode', ['on' => 'server'])

@task('healthCheck', ['on' => 'local'])
    $headers = get_headers($healthUrl);
    $response = $headers[0];
    echo {{ $healthUrl }} - {{ $response }}

Let me know if you have a better way!