DEV Community

Cover image for Laravel Actuator
shantanu basu
shantanu basu

Posted on

Laravel Actuator

Laravel Actuator: Spring Boot Monitoring for Laravel Apps

Production monitoring shouldn't be hard. But for Laravel developers,
it's been harder than it should be.

I built Laravel Actuator to fix that.

What is Laravel Actuator?

Laravel Actuator is a set of HTTP endpoints that give you real-time
visibility into your Laravel application's health, performance, and
configuration.

It's inspired by Spring Boot Actuator
—a battle-tested monitoring tool that Java developers have relied on
for years.

Now Laravel has it too.

The Problem

When you deploy a Laravel app to production, you need answers to:

  • Is the database connected?
  • Is the cache working?
  • Is disk space running low?
  • Are the queues healthy?
  • What version is running?

Right now, you either:

  • ❌ SSH into the server and check manually
  • ❌ Build custom monitoring endpoints
  • ❌ Use external services
  • ❌ Pray nothing breaks

It's 2026. We should have better tools.

The Solution

One command:

composer require sbasu/laravel-actuator
php artisan vendor:publish --tag=actuator-config
Enter fullscreen mode Exit fullscreen mode

Now your app has monitoring endpoints:

Health Check

curl http://localhost:8000/actuator/health
Enter fullscreen mode Exit fullscreen mode

Returns:

{
  "status": "UP",
  "components": {
    "database": { "status": "UP" },
    "disk_space": { "status": "UP" },
    "cache": { "status": "UP" },
    "queue": { "status": "UP" }
  },
  "timestamp": "2026-06-27T10:34:14Z"
}
Enter fullscreen mode Exit fullscreen mode

Metrics

curl http://localhost:8000/actuator/metrics
Enter fullscreen mode Exit fullscreen mode

Returns available performance metrics.

Application Info

curl http://localhost:8000/actuator/info
Enter fullscreen mode Exit fullscreen mode

Returns metadata about your app.

Real-World Use Cases

Kubernetes Deployments

Your Kubernetes cluster needs to know if your pod is healthy:

livenessProbe:
  httpGet:
    path: /actuator/health
    port: 8000
  initialDelaySeconds: 30
  periodSeconds: 10

readinessProbe:
  httpGet:
    path: /actuator/health
    port: 8000
  initialDelaySeconds: 10
  periodSeconds: 5
Enter fullscreen mode Exit fullscreen mode

If health check fails, Kubernetes automatically restarts the pod.

Docker Health Checks

HEALTHCHECK --interval=30s --timeout=3s \
  CMD curl -f http://localhost:8000/actuator/health || exit 1
Enter fullscreen mode Exit fullscreen mode

Load Balancer Health Checks

Your load balancer can route traffic only to healthy instances:

upstream laravel {
    server laravel-1:8000;
    server laravel-2:8000;
    server laravel-3:8000;

    check interval=3000 rise=2 fall=5 type=http;
    check_http_send "GET /actuator/health HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx;
}
Enter fullscreen mode Exit fullscreen mode

Monitoring & Alerting

Feed metrics to Prometheus/Grafana:

scrape_configs:
  - job_name: 'laravel-app'
    metrics_path: '/actuator/metrics'
    static_configs:
      - targets: ['localhost:8000']
Enter fullscreen mode Exit fullscreen mode

Key Features

Zero Configuration — Works out of the box

Kubernetes Ready — Built for container orchestration

Comprehensive — Database, cache, queue, disk checks

DevOps Friendly — Standard endpoints for tools

Secure by Default — Sensitive data hidden by default

Laravel Native — Uses Laravel service providers

Installation

Step 1: Install via Composer

composer require sbasu/laravel-actuator
Enter fullscreen mode Exit fullscreen mode

Step 2: Publish Configuration

php artisan vendor:publish --tag=actuator-config
Enter fullscreen mode Exit fullscreen mode

Step 3: Done!

php artisan serve
curl http://localhost:8000/actuator/health
Enter fullscreen mode Exit fullscreen mode

Security

The package is secure by default:

  • ✅ Health endpoints are public (safe)
  • ✅ Environment endpoint is disabled (security)
  • ✅ No sensitive data exposed
  • ✅ You can add authentication if needed

Only enable environment endpoint in development:
ACTUATOR_SHOW_ENV=true

Configuration

Customize behavior in config/actuator.php:

return [
    'path' => 'actuator',              // URI prefix
    'middleware' => ['api'],           // Applied middleware
    'indicators' => [                  // Health checks
        'database' => true,
        'disk_space' => true,
        'cache' => true,
        'queue' => true,
    ],
    'show_details' => true,            // Show health details
    'show_env' => false,               // Environment vars (disabled)
    'log_access' => false,             // Log requests
];
Enter fullscreen mode Exit fullscreen mode

Version Compatibility

  • PHP: 8.1+
  • Laravel: 10, 11, 12, 13+

What's Next?

This is the first in a series of Spring Boot → Laravel packages.

Coming soon:

  • Laravel Profiles (environment-specific configuration)
  • Laravel Repository (data access patterns)
  • Laravel Events (advanced event bus)

The goal: bring enterprise-grade patterns from Spring Boot to Laravel.

I'd Love Your Feedback

What Spring Boot patterns would you like to see in Laravel?
Comment below!

  • Configuration Server?
  • Repository Pattern?
  • Event Bus?
  • Something else?

Your feedback shapes the roadmap.

Links

GitHub Repo: https://github.com/sbasu/laravel-actuator
GitHub README: https://github.com/sbasu/laravel-actuator#readme
Packagist: https://packagist.org/packages/sbasu/laravel-actuator


Happy monitoring! 🚀

Top comments (0)