Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Myaku Health Check Laravel Package

devexploris/myaku-health-check

View on GitHub
Deep Wiki
Context7

Myaku Health Check

A Symfony bundle exposing a GET /health endpoint with access control and monitoring of disk space, RAM, database and cache.

Official (EN) documentation → Documentation officielle →

Requirements

  • PHP 8.2+
  • Symfony 7.4+ or 8.0+

Installation

1. Require the bundle

composer require devexploris/myaku-health-check

2. Register the bundle

// config/bundles.php
return [
    Devexploris\MyakuHealthCheck\MyakuHealthCheckBundle::class => ['all' => true],
];

3. Register the route

# config/routes.yaml
myaku_health_check:
    resource: Devexploris\MyakuHealthCheck\Controller\HealthCheckController
    type: attribute

Configuration

Create config/packages/myaku_health_check.yaml:

myaku_health_check:
    threshold:                              # optional
        space: 80                           # alert if disk usage exceeds X% (0–100)
        memory: 90                          # alert if RAM usage exceeds X% (0–100)
    space:
        path: /                             # mount point to monitor (default: /)
    security:
        token: "%env(APP_MYAKU_TOKEN)%"     # generate with: openssl rand -hex 24
        whitelist:                          # optional — if empty, all IPs are allowed
            - "127.0.0.1"
            - "172.21.0.1"

Database and cache are auto-detected via doctrine.dbal.default_connection and cache.app — no configuration needed.

Endpoint

GET /health

Response codes

Code Meaning
200 All checks are healthy
403 IP not allowed or invalid token
503 At least one check failed or exceeded its threshold

Security

Two controls are applied in order:

  1. IP whitelist — if the list is not empty, the client IP must be present, otherwise 403
  2. Token — the x-myaku-token header must match the configured token, otherwise 403

Response

{
    "space": {
        "free": "45.30 Go",
        "used": "54.70 Go",
        "total": "100.00 Go",
        "threshold": "80%",
        "threshold_targeted": false
    },
    "memory": {
        "free": "4.77 Go",
        "used": "10.04 Go",
        "total": "14.81 Go",
        "threshold": "90%",
        "threshold_targeted": false
    },
    "database": {
        "connected": true,
        "latency": "1.23ms"
    },
    "cache": {
        "connected": true,
        "latency": "0.45ms"
    }
}

threshold_targeted: true means the usage percentage exceeds the configured threshold — triggers a 503.

The threshold and threshold_targeted fields only appear if the corresponding threshold is configured.

Database error

{
    "database": {
        "connected": false,
        "error": "SQLSTATE[HY000] [2002] Connection refused"
    }
}

Cache error

{
    "cache": {
        "connected": false,
        "error": "No cache configured"
    }
}

Auto-detection

The bundle wires doctrine.dbal.default_connection and cache.app automatically when they are available in the container. No configuration needed — checks are simply skipped (returning connected: false) when the services are absent.

Compatibility

Check Linux macOS Windows
Disk space
RAM
Database
Cache

MemoryChecker reads /proc/meminfo — available on Linux only.

License

MIT

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity