Skip to content

Installation

  • PHP 8.2 or later
  • Laravel 12 or 13
  • For the metrics in production: a Redis server, with the phpredis extension or the predis/predis package. The optional Redis indicator needs the same client.
  1. Require the package with Composer:

    Terminal window
    composer require nwidart/laravel-actuator

    Laravel package discovery registers Nwidart\Actuator\ActuatorServiceProvider. You do not need to add it to bootstrap/providers.php.

    Composer also installs nwidart/laravel-metrics, which records the metrics. It starts at once, into the default Redis connection. Without Redis, the application keeps working, but its requests write a warning to the PHP error log. Set METRICS_STORE=cache to use a cache store, or METRICS_ENABLED=false to record nothing. See choose a metrics store.

  2. Check that the health endpoint answers:

    Terminal window
    curl -i http://localhost/actuator/health
    HTTP/1.1 200 OK
    Content-Type: application/json
    {"status":"UP","groups":["liveness","readiness"]}
  3. Optional: publish the configuration file to change the defaults:

    Terminal window
    php artisan vendor:publish --tag=actuator-config

    This copies the file to config/actuator.php. The configuration reference describes every key.

The package reads exposure, base_path and every middleware key when it registers its routes. If you run php artisan route:cache or php artisan optimize, rebuild the caches after you change one of these keys:

Terminal window
php artisan optimize:clear
php artisan optimize