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

Laravel Requests Monitor Laravel Package

chrishenrique/laravel-requests-monitor

Lightweight Laravel package to monitor, log, and analyze HTTP requests and custom app actions. Supports middleware auto-tracking, manual event registration, dedicated DB connection, configurable retention/pruning, and works with Laravel 7+ (PHP 7.4/8+).

View on GitHub
Deep Wiki
Context7

Laravel Requests Monitor

Latest Version on Packagist Total Downloads License

A lightweight Laravel package to monitor, log, and analyze HTTP requests and custom application actions.
Designed to be simple, extensible, and database-agnostic, it works seamlessly with legacy Laravel versions (7.x) and modern PHP versions.


Features

  • Automatic request monitoring via middleware
  • Manual action registration for business events
  • Dedicated database connection support
  • Configurable retention and pruning
  • Compatible with PHP 7.4 and PHP ^8.0
  • Ideal for auditing, analytics, and security tracking

Requirements

  • PHP 7.4 or ^8.0
  • Laravel 7.x or higher
  • Any database supported by Laravel

Installation

Install the package via Composer:

composer require chrishenrique/laravel-requests-monitor

Configuration

Publish Config File

php artisan vendor:publish --tag=requests-monitor-config

The config file will be available at:

config/requests-monitor.php

Database Setup

It is recommended to use a dedicated database or schema.

Create a database and configure a new connection named requests-monitor in config/database.php:

'connections' => [

    'requests-monitor' => [
        'driver' => 'mysql',
        'host' => env('DB_MONITOR_HOST', '127.0.0.1'),
        'port' => env('DB_MONITOR_PORT', '3306'),
        'database' => env('DB_MONITOR_DATABASE', 'requests_monitor'),
        'username' => env('DB_MONITOR_USERNAME', 'root'),
        'password' => env('DB_MONITOR_PASSWORD', ''),
        'charset' => 'utf8mb4',
        'collation' => 'utf8mb4_unicode_ci',
    ],

],

Migrations

Publish the migrations:

php artisan vendor:publish --tag=requests-monitor-migrations

Run them:

php artisan migrate

Middleware Registration

PHP ^8.0 (Laravel 9+)

use ChrisHenrique\RequestsMonitor\Middlewares\RequestMonitorMiddleware;

$middleware->appendToGroup('web', [
    RequestMonitorMiddleware::class,
]);

PHP 7.4 (Laravel 7 / 8)

In app/Http/Kernel.php:

protected $middlewareGroups = [
    'web' => [
        \ChrisHenrique\RequestsMonitor\Middlewares\RequestMonitorMiddleware::class,
    ],
];

Pruning Old Records (PHP 7.4)

Register the prune command in app/Console/Kernel.php:

protected function schedule(Schedule $schedule)
{
    $schedule->command('requests-monitor:prune')->daily();
}

You may also run it manually:

php artisan requests-monitor:prune

Manual Action Registration

You can manually register application-specific actions:

registerAction('billet.download', session('customer'));

This is useful for tracking business logic events that are not directly related to HTTP requests.


Typical Use Cases

  • HTTP request auditing
  • API usage monitoring
  • Business event tracking
  • Security and access logs
  • Performance and behavior analysis

Roadmap

  • Dashboard UI
  • Filters and advanced querying
  • Export and reporting tools

Contributing

Contributions are welcome!
Please open an issue or submit a pull request.


License

The MIT License (MIT). Please see the LICENSE file for more information.

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.
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium