{"id":21806389,"url":"https://github.com/svilborg/laravel-health","last_synced_at":"2026-05-06T10:35:45.198Z","repository":{"id":48332305,"uuid":"196577211","full_name":"svilborg/laravel-health","owner":"svilborg","description":"Laravel Health (MicroProfile Health Protocol)","archived":false,"fork":false,"pushed_at":"2021-08-01T03:17:10.000Z","size":534,"stargazers_count":3,"open_issues_count":13,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-26T14:42:33.110Z","etag":null,"topics":["api","health","health-check","healthcheck-endpoint","healthcheck-protocol","json","laravel","microprofile-health","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svilborg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-12T12:40:17.000Z","updated_at":"2023-09-10T01:26:37.000Z","dependencies_parsed_at":"2022-09-18T10:30:23.867Z","dependency_job_id":null,"html_url":"https://github.com/svilborg/laravel-health","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/svilborg/laravel-health","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svilborg%2Flaravel-health","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svilborg%2Flaravel-health/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svilborg%2Flaravel-health/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svilborg%2Flaravel-health/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svilborg","download_url":"https://codeload.github.com/svilborg/laravel-health/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svilborg%2Flaravel-health/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32689248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","health","health-check","healthcheck-endpoint","healthcheck-protocol","json","laravel","microprofile-health","php"],"created_at":"2024-11-27T12:19:20.736Z","updated_at":"2026-05-06T10:35:45.175Z","avatar_url":"https://github.com/svilborg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Health Check\n\n\n[![Build Status](https://travis-ci.org/svilborg/laravel-health.svg?branch=master)](https://travis-ci.org/svilborg/laravel-health)\n[![Coverage](https://codecov.io/gh/svilborg/laravel-health/branch/master/graph/badge.svg)](https://codecov.io/gh/svilborg/laravel-health)\n[![Quality Score](https://img.shields.io/scrutinizer/g/svilborg/laravel-health.svg)](https://scrutinizer-ci.com/g/svilborg/laravel-health)\n[![Latest Stable Version](https://img.shields.io/packagist/v/svilborg/laravel-health.svg)](https://packagist.org/packages/svilborg/laravel-health)\n[![License](https://img.shields.io/packagist/l/svilborg/laravel-health.svg)](https://github.com/svilborg/laravel-health/blob/master/LICENSE)\n\nImplementation of MicroProfile Health for Laravel\n\n[MicroProfile Health Protocol](https://github.com/eclipse/microprofile-health/blob/master/spec/src/main/asciidoc/protocol-wireformat.adoc \"Protocol\")\n\n### Configuration\n\nRegister the health check classes in config/health.php\n\n```php\n    return [\n        /*\n         * |--------------------------------------------------------------------------\n         * | Health Checks\n         * |--------------------------------------------------------------------------\n         * |\n         */\n\n        'checks' =\u003e [\n             [\n                 'class' =\u003e \\Health\\Checks\\NullCheck::class,\n                 'params' =\u003e []\n             ],\n             [\n                 'class' =\u003e \\Health\\Checks\\Servers\\Database::class,\n                 'params' =\u003e []\n             ],\n             [\n                 'class' =\u003e \\Health\\Checks\\Filesystem\\DiskSpace::class,\n                 'params' =\u003e [\n                    'path' =\u003e '/'\n                 ]\n             ],\n             [\n                'class' =\u003e \\Health\\Checks\\Env\\Environment::class,\n                'params' =\u003e [\n                     'APP_ENV' =\u003e 'testing'\n                 ]\n             ]\n        ]\n    ];\n```\n\nAdd the api route\n\n```php\n    Route::get('/health', 'Health\\Controllers\\HealthController@check');\n```\n\n### Example Response Payload\n\n```json\n\n{\n    \"status\": \"UP\",\n    \"checks\": [\n        {\n            \"name\": \"health-checks-null-check\",\n            \"status\": \"UP\",\n            \"data\": []\n        },\n        {\n            \"name\": \"health-checks-filesystem-disk-space\",\n            \"status\": \"UP\",\n            \"data\": {\n                \"free_bytes\": 119100669952,\n                \"free_human\": \"110.92 GB\",\n                \"path\": \"/\",\n                \"threshold\": 100000000\n            }\n        },\n        {\n            \"name\": \"health-checks-env-environment\",\n            \"status\": \"UP\",\n            \"data\": {\n                \"variable\": \"APP_ENV\",\n                \"value\": \"testing\",\n                \"value_expected\": \"testing\"\n            }\n        },\n        {\n            \"name\": \"health-checks-filesystem-directory-is-readable\",\n            \"status\": \"UP\",\n            \"data\": {\n                \"paths\": [\n                    \"../tests\"\n                ]\n            }\n        },\n        {\n            \"name\": \"health-checks-filesystem-file-is-readable\",\n            \"status\": \"UP\",\n            \"data\": {\n                \"files\": [\n                    \"TestCase.php\"\n                ]\n            }\n        }\n    ]\n}\n\n```\n\n### Custom Health Check\n\n```php\n    use Health\\Checks\\BaseCheck;\n    use Health\\Checks\\HealthCheckInterface;\n\n    class ServiceACheck extends BaseCheck implements HealthCheckInterface\n    {\n\n        /**\n         *\n         * {@inheritdoc}\n         * @see \\Health\\Checks\\HealthCheckInterface::call()\n         */\n        public function call()\n        {\n            $health = $this-\u003egetBuilder('Service A');\n\n            if(!$this-\u003eserviceA-\u003econnect()) {\n                $health-\u003ewithData('error', 'Service A Failed')\n                        -\u003edown();\n            }\n            else {\n                $health-\u003eup();\n            }\n\n            return $health-\u003ebuild();\n        }\n    }\n```\n\n\n### Health Check Cli Command\n\n    $ php artisan health\n\n        ✔ UP Health State\n        ==============================\n\n        ✔ UP health-checks-null-check\n        ✔ UP health-checks-filesystem-disk-space {\"free_bytes\":119302803456,\"free_human\":\"111.11 TB\",\"path\":\"\\/tmp\",\"threshold\":100000000}\n        ✔ UP health-checks-env-environment {\"variable\":\"APP_ENV\",\"value\":\"testing\",\"value_expected\":\"testing\"}\n        ✔ UP health-checks-filesystem-directory-is-readable {\"paths\":[\".\\/tests\"]}\n        ✔ UP health-checks-filesystem-file-is-readable {\"files\":[\".\\/tests\\/TestCase.php\"]}\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvilborg%2Flaravel-health","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvilborg%2Flaravel-health","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvilborg%2Flaravel-health/lists"}