bhhaskin/laravel-status 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bhhaskin/laravel-status

最新稳定版本:0.1.1

Composer 安装命令:

composer require bhhaskin/laravel-status

包简介

Health check API endpoint for Laravel applications.

README 文档

README

Tests

A simple Laravel package that provides a health check API endpoint for monitoring your application's status.

Features

  • Simple /health endpoint that returns JSON status
  • Database connectivity check
  • Cache connectivity check
  • Returns HTTP 200 for healthy, 503 for unhealthy
  • Configurable endpoint path and checks
  • Auto-discovery for Laravel

Installation

Install via Composer:

composer require bhhaskin/laravel-status

The package will automatically register itself via Laravel's package auto-discovery.

Usage

Once installed, the package automatically registers a /health endpoint that returns:

Healthy Response (200):

{
  "status": "ok"
}

Unhealthy Response (503):

{
  "status": "error"
}

Simply make a GET request to /health to check your application's status.

Configuration

Publish the configuration file (optional):

php artisan vendor:publish --tag=laravel-status-config

This creates config/status.php with the following options:

return [
    // Enable or disable the status check endpoint
    'enabled' => env('STATUS_CHECK_ENABLED', true),

    // The path for the status check endpoint
    'path' => env('STATUS_CHECK_PATH', 'health'),

    // Middleware to apply to the status check endpoint
    'middleware' => [],

    // Configure which health checks to run
    'checks' => [
        'database' => env('STATUS_CHECK_DATABASE', true),
        'cache' => env('STATUS_CHECK_CACHE', true),
    ],
];

Environment Variables

You can configure the package using environment variables:

STATUS_CHECK_ENABLED=true
STATUS_CHECK_PATH=health
STATUS_CHECK_DATABASE=true
STATUS_CHECK_CACHE=true

Testing

Run the test suite:

composer test

Requirements

  • PHP 8.1 or higher
  • Laravel 10.x or 11.x

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固