Skip to content

Commit 15b2053

Browse files
authored
Merge branch 'master' into patch-1
2 parents cfe8890 + 673d979 commit 15b2053

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
php: [8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, 5.6]
17+
php: [8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0, 5.6]
1818

1919
name: PHP${{ matrix.php }} - ubuntu-latest
2020

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This package also adds a `/ping` endpoint. Just hit `/ping` and receive `pong` i
1313

1414
To install the package:
1515

16-
Run `composer require ukfast/laravel-health-check` to add the package to your dependencies.
16+
Run `composer require ans-group/laravel-health-check` to add the package to your dependencies.
1717

1818
This will automatically install the package to your vendor folder.
1919

composer.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,25 @@
5050
"config": {
5151
"sort-packages": true,
5252
"allow-plugins": {
53-
"kylekatarnls/update-helper": true
53+
"kylekatarnls/update-helper": true
5454
}
5555
},
5656
"prefer-stable": true,
5757
"require": {
5858
"php": ">=5.6",
5959
"ext-json": "*",
60-
"illuminate/support": "^5.4|^6.0|^7.0|^8.0|^9.0",
61-
"illuminate/http": "^5.4|^6.0|^7.0|^8.0|^9.0",
62-
"illuminate/console": "^5.4|^6.0|^7.0|^8.0|^9.0",
60+
"illuminate/support": "^5.4|^6.0|^7.0|^8.0|^9.0|^10.0",
61+
"illuminate/http": "^5.4|^6.0|^7.0|^8.0|^9.0|^10.0",
62+
"illuminate/console": "^5.4|^6.0|^7.0|^8.0|^9.0|^10.0",
6363
"nesbot/carbon": "^1.26.3|^2.0"
6464
},
6565
"require-dev": {
66-
"phpunit/phpunit": ">=5.0",
67-
"orchestra/testbench": "^3.0|^4.0|^5.0|^6.0",
66+
"phpunit/phpunit": ">=5.0 <10",
67+
"orchestra/testbench": "^3.0|^4.0|^5.0|^6.0|^8.0",
6868
"mockery/mockery": "^1.0",
69-
"illuminate/database": "^5.4|^6.0|^7.0|^8.0|^9.0",
70-
"illuminate/log": "^5.4|^6.0|^7.0|^8.0|^9.0",
71-
"illuminate/redis": "^5.4|^6.0|^7.0|^8.0|^9.0",
69+
"illuminate/database": "^5.4|^6.0|^7.0|^8.0|^9.0|^10.0",
70+
"illuminate/log": "^5.4|^6.0|^7.0|^8.0|^9.0|^10.0",
71+
"illuminate/redis": "^5.4|^6.0|^7.0|^8.0|^9.0|^10.0",
7272
"guzzlehttp/guzzle": ">=5.6.3"
7373
},
7474
"suggest": {

config/healthcheck.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@
7777
*/
7878
'default-response-code' => 200,
7979

80+
/*
81+
* Default code for HTTP health check when there any problem occured.
82+
* Will be used in the HealthCheckController's response.
83+
*/
84+
'default-problem-http-code' => 500,
85+
8086
/*
8187
* Default timeout for cURL requests for HTTP health check.
8288
*/

src/Checks/StorageHealthCheck.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class StorageHealthCheck extends HealthCheck
1818

1919
public function status()
2020
{
21-
$uniqueString = uniqid('laravel-health-check_');
21+
$uniqueString = uniqid('laravel-health-check_', true);
2222

2323
foreach (config('healthcheck.storage.disks') as $disk) {
2424
try {

src/Controllers/HealthCheckController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ public function __invoke(Container $container)
3737
}
3838

3939
return response()
40-
->json($body, in_array(Arr::get($body, 'status'), [Status::DEGRADED, Status::OKAY]) ? 200 : config('healthcheck.default-problem-http-code', 500));
40+
->json(
41+
$body,
42+
in_array(Arr::get($body, 'status'), [Status::DEGRADED, Status::OKAY]) ? 200
43+
: config('healthcheck.default-problem-http-code', 500)
44+
);
4145
}
4246
}

src/Status.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class Status
1919
/** @var string */
2020
protected $message = '';
2121

22+
/** @var array */
23+
protected $context = [];
24+
2225
/**
2326
* Marks the status as a problem
2427
*

0 commit comments

Comments
 (0)