PHPackages                             askerakbar/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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. askerakbar/lens

ActiveLaminas-module[Logging &amp; Monitoring](/categories/logging)

askerakbar/lens
===============

A sleek, developer-friendly SQL query logger for Laminas MVC applications.

0.0.4(9mo ago)18MITPHP

Since Jul 29Pushed 9mo agoCompare

[ Source](https://github.com/askerakbar/lens)[ Packagist](https://packagist.org/packages/askerakbar/lens)[ RSS](/packages/askerakbar-lens/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (6)Versions (3)Used By (0)

Laminas Lens - Query Logger
===========================

[](#laminas-lens---query-logger)

A sleek, simple, SQL query logger for Laminas MVC applications.

### Quick Start

[](#quick-start)

1. **Install via Composer**

    ```
    composer require askerakbar/lens --dev

    ```
2. **Register the module** (if not auto-discovered): Add to `config/modules.config.php`:

    ```
    AskerAkbar\Lens
    ```
3. **Run the migration** to create the database table (see [Storage](#storage)).
4. **Access the UI** by visiting `/lens` in your browser.

> You'll see a dashboard like this: [![Laminas Lens UI Screenshot](screenshot.png)](screenshot.png)

> **Note:** Database storage is enabled by default and requires the migration.

---

Features
--------

[](#features)

- Logs all executed DB queries
- Displays SQL, parameters, timing, stack trace, and connection info
- Search functionality
- database-backed storage

---

### Notes

[](#notes)

This library has been tested **only** against:

- **Laminas MVC ^3.7.0**
- **PHP 8.1 / 8.2 / 8.3**
- **PDO\_MySQL** (MySQL / MariaDB)
- **Requires `laminas/laminas-cli`**
- Requires database connection to be configured

> This tool is intended for development use only. Other DB backends, PHP, or other Laminas versions are **untested** and may not work as expected. if you find issues please feel free to make a PR.

---

Storage
-------

[](#storage)

### Database Storage

[](#database-storage)

Database storage is the default and requires a database table to be created. Configure your app config with the following in (`config/autoload/global.php` or `local.php`) if needed:

```
'lens' => [
    'storage' => [
        'type'  => 'database',
        'table' => 'lens_logs', // Optional, default: lens_logs
    ],
],
```

---

### Running the Migration

[](#running-the-migration)

1. **Publish migration:**

    ```
    vendor/bin/laminas lens:publish-migration
    # Optional target directory:
    vendor/bin/laminas lens:publish-migration
    ```
2. **Run the migration:**

    - **SQL migration:** Execute the generated SQL file using your preferred method
    - **Doctrine migration:** Run `vendor/bin/doctrine-migrations migrate` (if using Doctrine)

---

### Troubleshooting

[](#troubleshooting)

### Xdebug: Segmentation Fault When Publishing Migrations

[](#xdebug-segmentation-fault-when-publishing-migrations)

If you see errors like:

```
Cannot load Xdebug - it was already loaded
Xdebug: [Step Debug] Could not connect to debugging client...
Segmentation fault (core dumped)

```

Disable Xdebug for the session:

```
export XDEBUG_MODE=off
vendor/bin/laminas lens:publish-migration --target=database/migrations
```

---

### License

[](#license)

MIT License. See [License.md](License.md) for details.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance57

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 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

285d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/27cd8f1d93e3e178a5294a8fc9e7570629b082b728754aae8f2d3d23be1c71a6?d=identicon)[asker-akbar](/maintainers/asker-akbar)

---

Top Contributors

[![askerakbar](https://avatars.githubusercontent.com/u/43740952?v=4)](https://github.com/askerakbar "askerakbar (6 commits)")

---

Tags

laminaslaminas-dblaminas-modulelaminas-mvc

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/askerakbar-lens/health.svg)

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

###  Alternatives

[magento/community-edition

Magento 2 (Open Source)

12.1k52.1k10](/packages/magento-community-edition)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[codemix/yii2-streamlog

A Yii 2 log target for streams in URL format

531.4M6](/packages/codemix-yii2-streamlog)[neeckeloo/newrelic

NewRelic module for Laminas

32207.2k](/packages/neeckeloo-newrelic)

PHPackages © 2026

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