Laravel HTTP client response helpers

Shortcut helper functions when using the Laravel HTTP client to validate HTTP responses.

Instead of manually checking an HTTP response status code, you can use the Laravel HTTP client helpers.

successful() will return true if the HTTP response code is equal or greater than 200 and less than 300

$response->successful();

Whilst failed() will return true if the HTTP response code is equal or greater than 400.

$response->failed();

serverError() is true if the HTTP status code is equal or above 500.

$response->serverError();