PHPackages                             pimvdmolen/request-cost-indicator - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. pimvdmolen/request-cost-indicator

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

pimvdmolen/request-cost-indicator
=================================

A lightweight, always-visible request cost awareness and analysis indicator for Laravel applications (local/staging only).

v0.1.1(6mo ago)01MITPHPPHP ^8.3

Since Dec 21Pushed 6mo agoCompare

[ Source](https://github.com/pimvdmolen/laravel-request-cost-indicator)[ Packagist](https://packagist.org/packages/pimvdmolen/request-cost-indicator)[ Docs](https://github.com/pimvdmolen/laravel-request-cost-indicator)[ RSS](/packages/pimvdmolen-request-cost-indicator/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (3)Versions (3)Used By (0)

Laravel Request Cost Indicator
==============================

[](#laravel-request-cost-indicator)

[![Laravel](https://camo.githubusercontent.com/678411262186b179d531f0bc05f7f7e496b0eee20f54b4cac344adbcb00ba50f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322b2d7265642e737667)](https://camo.githubusercontent.com/678411262186b179d531f0bc05f7f7e496b0eee20f54b4cac344adbcb00ba50f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322b2d7265642e737667)[![PHP](https://camo.githubusercontent.com/441e87937b80b76202762bc6545f7bef77b6f46a529faeb339b4ee87f533a588/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d3737376262342e737667)](https://camo.githubusercontent.com/441e87937b80b76202762bc6545f7bef77b6f46a529faeb339b4ee87f533a588/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d3737376262342e737667)

A lightweight, always-visible request cost **awareness and analysis** indicator for Laravel applications.

Designed to make expensive requests impossible to ignore, while allowing you to drill down into *why* they are expensive when you choose to.

---

What this package does
----------------------

[](#what-this-package-does)

On every HTML page load (local/staging only), it shows:

- A small, fixed indicator at the bottom of the page with:

    - Total request time (ms)
    - Number of database queries
- An expandable panel with:

    - A visual cost breakdown (Database / HTTP / Views / Other)
    - Minimal counters
    - A short interpretation sentence

Optionally, you can enable **details mode**, which captures additional data for the current request:

- Aggregated database query timings (grouped, no SQL output)
- External HTTP call timings
- View render timings
- Source locations (file + line, relative to project root)

The default mode is intentionally lightweight. Details are only collected when you explicitly ask for them.

---

What this package deliberately does **not** do (for now)
--------------------------------------------------------

[](#what-this-package-deliberately-does-not-do-for-now)

- ❌ No per-query SQL inspection
- ❌ No raw stack traces by default
- ❌ No JSON / API response support
- ❌ No frontend frameworks or build steps
- ❌ No production usage

These boundaries are intentional and may evolve as the package grows.

---

Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 12+

Intended for:

- `local`
- optionally `staging`

Never intended for production environments.

---

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

[](#installation)

Install the package as a dev dependency:

```
composer require pimvdmolen/request-cost-indicator --dev
```

No service provider registration is required. No assets need to be published.

Refresh a page and the indicator will appear automatically.

---

Enabling or disabling the indicator
-----------------------------------

[](#enabling-or-disabling-the-indicator)

By default, the indicator is enabled when:

- `APP_DEBUG=true`
- The application environment is `local`

You can control this via your `.env` file.

### Enable

[](#enable)

```
APP_DEBUG=true
```

### Disable (recommended for production)

[](#disable-recommended-for-production)

```
APP_DEBUG=false
```

You can also fine-tune this behavior in `config/request-cost-indicator.php`.

---

Details mode
------------

[](#details-mode)

By default, the indicator runs in a low-overhead mode.

To enable details for the current request:

1. Open the panel
2. Click **Details**

This triggers a page reload and enables deeper measurements for that request.

⚠️ Details mode adds overhead due to additional timing and stack inspection. Turn it off when you’re done.

---

Themes
------

[](#themes)

The indicator supports:

- Light mode
- Dark mode

Your preference is stored in a cookie and persists across page loads.

---

Design philosophy
-----------------

[](#design-philosophy)

This package is built around a simple idea:

> Make request cost visible first, explain it second.

You should notice expensive requests immediately, and only then decide how far you want to drill down.

The goal is to reduce the friction between noticing a performance problem and understanding where it comes from.

---

License
-------

[](#license)

MIT

---

Author
------

[](#author)

Built by Pim van der Molen

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance67

Regular maintenance activity

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Every ~0 days

Total

2

Last Release

194d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/64087604?v=4)[pimvdmolen](/maintainers/pimvdmolen)[@pimvdmolen](https://github.com/pimvdmolen)

---

Top Contributors

[![pimvdmolen](https://avatars.githubusercontent.com/u/64087604?v=4)](https://github.com/pimvdmolen "pimvdmolen (5 commits)")

---

Tags

requestlaravelperformancedebuggingprofilinglaravel-packageobservability

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pimvdmolen-request-cost-indicator/health.svg)

```
[![Health](https://phpackages.com/badges/pimvdmolen-request-cost-indicator/health.svg)](https://phpackages.com/packages/pimvdmolen-request-cost-indicator)
```

###  Alternatives

[laracraft-tech/laravel-xhprof

Easy XHProf setup to profile your laravel application!

235358.7k](/packages/laracraft-tech-laravel-xhprof)[noisebynorthwest/php-spx

A simple &amp; straight-to-the-point PHP profiling extension with its built-in web UI

2.6k2.6k](/packages/noisebynorthwest-php-spx)[bavix/laravel-xhprof

Quick profiling of your code for Laravel

22157.5k](/packages/bavix-laravel-xhprof)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)[mateffy/laraperf

Performance analysis toolkit for AI coding agents — SQL query profiling, N+1 detection, EXPLAIN ANALYZE, via Artisan commands outputting structured JSON.

101.7k](/packages/mateffy-laraperf)

PHPackages © 2026

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