{"id":19998886,"url":"https://github.com/oved-php/health-checks","last_synced_at":"2025-05-04T14:31:12.034Z","repository":{"id":42952757,"uuid":"81751854","full_name":"OveD-php/health-checks","owner":"OveD-php","description":"Laravel health checker","archived":false,"fork":false,"pushed_at":"2022-03-26T00:46:44.000Z","size":588,"stargazers_count":37,"open_issues_count":9,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T05:38:51.858Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/OveD-php.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-12T19:43:35.000Z","updated_at":"2024-06-20T05:56:25.000Z","dependencies_parsed_at":"2022-08-19T10:32:44.636Z","dependency_job_id":null,"html_url":"https://github.com/OveD-php/health-checks","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OveD-php%2Fhealth-checks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OveD-php%2Fhealth-checks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OveD-php%2Fhealth-checks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OveD-php%2Fhealth-checks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OveD-php","download_url":"https://codeload.github.com/OveD-php/health-checks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252349434,"owners_count":21733832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-13T05:09:46.921Z","updated_at":"2025-05-04T14:31:11.707Z","avatar_url":"https://github.com/OveD-php.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Health Checks\n[![Build Status](https://travis-ci.org/phpsafari/health-checks.svg?branch=master)](https://travis-ci.org/phpsafari/health-checks)\n\nAdd health checks to your Laravel applications with this package.\n\n## Examples\n\n![All passed](/img/passed.png \"Health checks via commandline\")\n![DB failed](/img/db-not-up-to-date.png \"Database is not up-to-date\")\n![Queue failed](/img/queue-not-processing.png \"Queue is not processing\")\n![Url stats](/img/health-stats.png \"Health checks stats via URL\")\n\n## Install\n\nFirst, use Composer to install this package.\n```bash\n$ composer require phpsafari/health-checks\n```\n\nAfter the package has been installed, go ahead and add ``PhpSafari\\ServiceProvider\\HealthCheckServiceProvider::class` to your `config/app.php` file.\n\nAfter doing this, you can publish the `health.php` configuration file into your `config` folder by running:\n\n```bash\n$ php artisan vendor:publish --tag=health\n```\n\n## Usage\n\nInside the `config/health.php` file is where you configure all your available health checks. By default, this package comes packed with a few checks already:\n\n* `CorrectEnvironment` will check if your application's environment is set to `production`\n* `DatabaseOnline` will check your database connection\n* `DatabaseUpToDate` will check if your application has any migrations that hasn't been migrated yet\n* `DebugModeOff` will check if debug mode is off\n* `QueueProcessing` will check if the queue is running and jobs are getting processed\n* `PathIsWritable` will check if a provided path is writable\n* `LogLevel` will check if log level is set to the given value\n* `MaxRatioOf500Responses` will check if the ratio of 500 response are above a given threshold (The last 60 min)\n* `MaxResponseTimeAvg` will check if average response time for all request are above a given threshold (The last 60 min)\n\nTo run a health check of your application, run:\n\n```bash\n$ php artisan health:check\n```\n\nYou can also use Laravel's scheduler to schedule your health checks:\n\n```php\n$schedule-\u003ecommand('health:check')-\u003ehourly();\n``` \n\n### Url based health checks\n\nYou can also run a health check by hitting the `https://\u003cAPP_URL\u003e/_health` url in a browser or with a tool like Pingdom.\n\n**Note:** _This feature can be disabled in the `config/health.php` file, by setting `route.enabled` to `false`.\n\nYou can navigate to `https://\u003cAPP_URL\u003e/_health/stats` and get all stats, including avg response time,\n\n### Creating your own health checks\n\nIn order to create your own health checks, you just need to extend the `PhpSafari\\Checks\\HealthCheck` class and implement the `run()` method.\n\n**Example:**\n\n```php\nclass IsFriday extends PhpSafari\\Checks\\HealthCheck\n{\n    public function run(): bool\n    {\n        return Carbon::now()-\u003eisFriday();\n    }\n}\n```\n\nThen add `new IsFriday()` to the list of checks in `config/health.php`.\n\n\n## Testing\n\n``` bash\n$ phpunit tests/\n```\n\n## Security\n\nIf you discover any security related issues, please email :author_email instead of using the issue tracker.\n\n## Credits\n\n- [Visti Kløft](https://github.com/vistik)\n- [Peter Suhm](https://github.com/petersuhm)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foved-php%2Fhealth-checks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foved-php%2Fhealth-checks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foved-php%2Fhealth-checks/lists"}