PHPackages                             rakibuddin101/laravel-server-lens - 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. [Admin Panels](/categories/admin)
4. /
5. rakibuddin101/laravel-server-lens

ActiveLibrary[Admin Panels](/categories/admin)

rakibuddin101/laravel-server-lens
=================================

Real-time server observability &amp; traffic monitoring dashboard for Laravel.

v1.0.0(2mo ago)03MITPHPPHP ^8.1

Since May 5Pushed 2mo agoCompare

[ Source](https://github.com/rakibuddin101/laravel-server-lens)[ Packagist](https://packagist.org/packages/rakibuddin101/laravel-server-lens)[ RSS](/packages/rakibuddin101-laravel-server-lens/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Laravel Server Lens
===================

[](#laravel-server-lens)

[![Latest Version on Packagist](https://camo.githubusercontent.com/37de41227609dcb5921caf862efe3b83f0edbbdcd4ff044703ea9710f18d1b3c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72616b6962756464696e3130312f6c61726176656c2d7365727665722d6c656e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rakibuddin101/laravel-server-lens)[![GitHub Tests Action Status](https://camo.githubusercontent.com/cbe6b5ed613a4ca62a3f5be9895bf1bff14e5dead35a0fe6114162a5fc4d96ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72616b6962646576732f6c61726176656c2d7365727665722d6c656e732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/rakibdevs/laravel-server-lens/actions?query=workflow%3Arun-tests+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3b8db0a5a43f754e88af6fe50fe7ce506c2816f95c39622b323430e0238aac03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72616b6962756464696e3130312f6c61726176656c2d7365727665722d6c656e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rakibuddin101/laravel-server-lens)[![License: MIT](https://camo.githubusercontent.com/458425f8985b0b0c8a736cffe75e05a098e3d77906acddbcad2bfc54492a4e02/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A plug-and-play server observability and traffic monitoring dashboard for Laravel. Get live CPU, RAM, disk metrics, service health checks, a real-time request feed with bot detection, and IP blocking — all in one embeddable dashboard with no external services and no build step required.

[![Dashboard Preview](https://github.com/rakibuddin101/laravel-server-lens/raw/main/art/preview.png)](https://github.com/rakibuddin101/laravel-server-lens/blob/main/art/preview.png)

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

[](#installation)

You can install the package via Composer:

```
composer require rakibuddin101/laravel-server-lens
```

Run the installer to publish config, migrations, and assets:

```
php artisan server-lens:install
```

Run the migrations:

```
php artisan migrate
```

You can publish the config file with:

```
php artisan vendor:publish --tag="server-lens-config"
```

You can publish the views to customise the dashboard:

```
php artisan vendor:publish --tag="server-lens-views"
```

Usage
-----

[](#usage)

Visit the dashboard at `/ops` (or whatever `route_prefix` you configured):

```
http://your-app.test/ops

```

### Accessing the dashboard

[](#accessing-the-dashboard)

The `/ops` route is protected by the `web` and `auth` middleware out of the box. If you visit it without being logged in, Laravel will redirect you to the login page — this is intentional to keep server metrics private.

**You must be authenticated** (logged in to your app) before you can view the dashboard.

To restrict access further — for example, to admins only — update the `middleware` key in `config/server-lens.php`:

```
// config/server-lens.php
'middleware' => ['web', 'auth', 'can:admin'],   // Laravel Gate
'middleware' => ['web', 'auth', 'role:admin'],   // Spatie Permissions / your own middleware
```

To allow any authenticated user (the default):

```
'middleware' => ['web', 'auth'],
```

To open the dashboard without any login requirement (**not recommended in production**):

```
'middleware' => ['web'],
```

### Programmatic access

[](#programmatic-access)

```
use Rakib\ServerLens\Facades\ServerLens;

$snapshot = ServerLens::snapshot();    // full metrics, health, and activity
$health   = ServerLens::healthOnly();  // health checks only
$metrics  = ServerLens::metricsOnly(); // CPU, RAM, Disk
```

### Custom health checks

[](#custom-health-checks)

Implement the `HealthCheck` contract and register it in a service provider:

```
use Rakib\ServerLens\Contracts\HealthCheck;
use Rakib\ServerLens\Data\CheckResult;

class StripeApiCheck implements HealthCheck
{
    public function name(): string { return 'Stripe API'; }

    public function run(): CheckResult
    {
        $start = microtime(true);
        // your probe logic here
        $ms = round((microtime(true) - $start) * 1000, 2);

        return CheckResult::healthy("Reachable in {$ms} ms", $ms);
    }
}
```

```
// In AppServiceProvider::boot()
use Rakib\ServerLens\Facades\ServerLens;

ServerLens::registerCheck(new StripeApiCheck());
```

### Artisan commands

[](#artisan-commands)

```
# Run all health checks and print results
php artisan server-lens:check

# Delete traffic logs older than prune_after_days
php artisan server-lens:prune

# Block an IP address (add --hours=N for a temporary block)
php artisan server-lens:block 203.0.113.42
php artisan server-lens:block 203.0.113.42 --hours=24

# Remove an IP block
php artisan server-lens:unblock 203.0.113.42
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Rakib Uddin](https://github.com/rakibuddin101)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance84

Actively maintained with recent releases

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

80d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17265304?v=4)[Rakib Uddin](/maintainers/rakibuddin101)[@rakibuddin101](https://github.com/rakibuddin101)

---

Top Contributors

[![rakibuddin101](https://avatars.githubusercontent.com/u/17265304?v=4)](https://github.com/rakibuddin101 "rakibuddin101 (10 commits)")

---

Tags

laravelserverdashboardmonitorobservabilitytraffic

### Embed Badge

![Health badge](/badges/rakibuddin101-laravel-server-lens/health.svg)

```
[![Health](https://phpackages.com/badges/rakibuddin101-laravel-server-lens/health.svg)](https://phpackages.com/packages/rakibuddin101-laravel-server-lens)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M136](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M133](/packages/roots-acorn)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k96.5k1](/packages/mike-bronner-laravel-model-caching)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
