PHPackages                             m-derakhshi/laravel-top - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. m-derakhshi/laravel-top

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

m-derakhshi/laravel-top
=======================

Real-time monitoring straight from the command line for Laravel applications.

1.0.6(1y ago)06MITPHPPHP ^8.2.0

Since Mar 8Pushed 1y agoCompare

[ Source](https://github.com/m-derakhshi/laravel-top)[ Packagist](https://packagist.org/packages/m-derakhshi/laravel-top)[ Docs](https://github.com/leventcz/laravel-top)[ RSS](/packages/m-derakhshi-laravel-top/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (5)Versions (6)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/118c4915f12591b38dcd6a56ed258fadf53206e5c0390a181354c1941f9f38bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6576656e74637a2f6c61726176656c2d746f702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leventcz/laravel-top)[![GitHub Tests Action Status](https://camo.githubusercontent.com/c18613fa607aeaaa42ff77b86449e8a73e555ff3c9c48d0848e1aca549ded9e0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6576656e74637a2f6c61726176656c2d746f702f74657374732e796d6c3f6272616e63683d312e78266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/leventcz/laravel-top/actions)[![Licence](https://camo.githubusercontent.com/e2be541c786548e30bd3ed9355983e0e202f5876ffce3309c45ab861a3c96cc7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c6576656e74637a2f6c61726176656c2d746f702e7376673f7374796c653d666c61742d737175617265)](https://github.com/leventcz/laravel-top/actions)

[![leventcz%2Flaravel-top | Trendshift](https://camo.githubusercontent.com/46824cdefb874fc2874bc3f875ae2f329d60637b48aceca6ee5deb3fc5f5ff3d/68747470733a2f2f7472656e6473686966742e696f2f6170692f62616467652f7265706f7369746f726965732f3130333338)](https://trendshift.io/repositories/10338)

[![Real-time monitoring with Laravel Top](/art/top.gif)](/art/top.gif)

```
php artisan top
```

**Top** provides a lightweight solution for real-time monitoring directly from the command line for Laravel applications. It is designed for production environments, enabling you to effortlessly track essential metrics and identify the busiest routes.

How it works
------------

[](#how-it-works)

**Top** listens to Laravel events and saves aggregated data to Redis behind the scenes to calculate metrics. The aggregated data is stored with a short TTL, ensuring that historical data is not retained and preventing Redis from becoming overloaded. During display, metrics are calculated based on the average of the last 5 seconds of data.

**Top** only listens to events from incoming requests, so metrics from operations performed via queues or commands are not reflected.

Since the data is stored in Redis, the output of the top command reflects data from all application servers, not just the server where you run the command.

Installation
------------

[](#installation)

> Compatible with Laravel 10, Laravel 11, and Laravel Octane.

> **Requires [PHP 8.2+](https://php.net/releases/) | [Redis 5.0+](https://redis.io)**

```
composer require leventcz/laravel-top
```

Configuration
-------------

[](#configuration)

You can publish the config file with:

```
php artisan vendor:publish --tag="top"
```

```
