webmavens/debug-monitor

Laravel debug / data rule monitoring package

Maintainers

Package info

github.com/webmavens/laravel-debug

Language:Blade

pkg:composer/webmavens/debug-monitor

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

0.1 2026-06-23 10:00 UTC

This package is auto-updated.

Last update: 2026-06-23 10:24:30 UTC


README

A lightweight Laravel package that helps developers and administrators automatically run SQL-based health checks, detect data anomalies, and get notified when something goes wrong.

๐Ÿš€ Features

  • ๐Ÿ” Define SQL-based debug rules directly from the web UI
  • ๐Ÿ•’ Run rules automatically via scheduler or manually using an Artisan command
  • ๐Ÿ“Š Store and view detailed execution logs
  • ๐Ÿงน Automatically clean old logs (configurable retention)
  • โœ‰๏ธ Send email notifications for failed rules
  • โš™๏ธ Supports SQLite and MySQL
  • ๐Ÿ”’ Secure access with a local-by-default gate and optional email allowlist
  • ๐Ÿงฑ Easy to extend and customize

๐Ÿ“ฆ Installation

Require the package via Composer:

composer require webmavens/debug-monitor

โš™๏ธ Publishing Configuration, Views & Provider

Publish configuration:

php artisan vendor:publish --provider="Webmavens\DebugMonitor\DebugMonitorServiceProvider" --tag=config

Publish views:

php artisan vendor:publish --provider="Webmavens\DebugMonitor\DebugMonitorServiceProvider" --tag=views

Publish migrations

php artisan vendor:publish --provider="Webmavens\DebugMonitor\DebugMonitorServiceProvider" --tag=migrations

Run the migrations:

php artisan migrate

๐Ÿ”‘ Authentication

By default, Debug Monitor is accessible in the local environment only.

Customizing Access

Set one or both of these environment values:

DEBUG_MONITOR_ALLOW_IN_LOCAL=true
DEBUG_MONITOR_ALLOWED_EMAILS=admin@example.com,dev@example.com
  • DEBUG_MONITOR_ALLOW_IN_LOCAL=true keeps the dashboard open in local.
  • DEBUG_MONITOR_ALLOWED_EMAILS is a comma-separated allowlist used when APP_ENV is not local.

You do not need to publish or register a custom provider for the default access behavior.

๐Ÿงญ Usage

๐Ÿ–ฅ๏ธ Web Dashboard

Visit /debug-monitor/rules to:

  • View all rules
  • Create new rules
  • Edit or delete rules
  • Suppress temporarily
  • Review logs

โšก Run Scheduler

php artisan schedule:work

โšก Run Manually

Run all active rules manually via Artisan:

php artisan debug-monitor:run

๐Ÿงน Log Cleanup (Automatic Maintenance)

Old logs can be automatically deleted using the built-in cleanup command.

Run Manually:

php artisan debug-monitor:clean
or
php artisan debug-monitor:clean --days=7

Configure Retention Period:

In config/debug-monitor.php:

'log_retention_days' => env('DEBUG_MONITOR_LOG_RETENTION_DAYS', 30),

๐Ÿงฐ Example Debug Rule

You can define rules such as:

Name SQL Query Frequency Expected Rows
Missing Users SELECT * FROM users WHERE email IS NULL 15 minutes 0
Stuck Orders SELECT * FROM orders WHERE status='pending' AND created_at < NOW() - INTERVAL 2 HOUR 10 minutes 0

When a rule fails (unexpected result), the system:

  • Logs it in the debug_rule_logs table
  • Updates its last run time
  • Sends an alert (if notifications are enabled)

๐Ÿ“ฌ Notifications

Set up your mail credentials in .env and configure the email notification in your config/debug-monitor.php file:

'notify_email' => env('DEBUG_MONITOR_NOTIFY_EMAIL', 'admin@example.com'),

Failed rules will trigger an email with detailed information.

Support

For any issues, feel free to create an issue in the GitHub repository.

๐Ÿค Contributing

Pull requests are welcome! If youโ€™d like to improve or extend this package, please fork the repo and create a PR.

๐Ÿง  License

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