PHPackages                             nfaiz/dbtoolbar - 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. [Database &amp; ORM](/categories/database)
4. /
5. nfaiz/dbtoolbar

ActiveLibrary[Database &amp; ORM](/categories/database)

nfaiz/dbtoolbar
===============

CodeIgniter 4 Database Debug Toolbar Query Highlighter.

v1.0.1(2y ago)78.9k1MITPHP

Since Jul 25Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nfaiz/dbtoolbar)[ Packagist](https://packagist.org/packages/nfaiz/dbtoolbar)[ Docs](https://github.com/nfaiz/dbtoolbar)[ RSS](/packages/nfaiz-dbtoolbar/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (10)Dependencies (2)Versions (13)Used By (1)

[![GitHub](https://camo.githubusercontent.com/e7b8090f87dd9445eeeff3cd836842e9e53313f0bfb90b07642f3757e3e93f35/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6661697a2f6462746f6f6c626172)](https://camo.githubusercontent.com/e7b8090f87dd9445eeeff3cd836842e9e53313f0bfb90b07642f3757e3e93f35/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6e6661697a2f6462746f6f6c626172)[![GitHub repo size](https://camo.githubusercontent.com/fa1ff19d8c759af4a170d47fb6215233d3131b314bc0ce0305f01662de5941fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6e6661697a2f6462746f6f6c6261723f6c6162656c3d73697a65)](https://camo.githubusercontent.com/fa1ff19d8c759af4a170d47fb6215233d3131b314bc0ce0305f01662de5941fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f6e6661697a2f6462746f6f6c6261723f6c6162656c3d73697a65)[![Hits](https://camo.githubusercontent.com/e7b6482c7841eddda66a1f00ba21adc432c355a7e1f1c9641d531c6556f375e7/68747470733a2f2f686974732e736565796f756661726d2e636f6d2f6170692f636f756e742f696e63722f62616467652e7376673f75726c3d6e6661697a2f6462746f6f6c626172)](https://camo.githubusercontent.com/e7b6482c7841eddda66a1f00ba21adc432c355a7e1f1c9641d531c6556f375e7/68747470733a2f2f686974732e736565796f756661726d2e636f6d2f6170692f636f756e742f696e63722f62616467652e7376673f75726c3d6e6661697a2f6462746f6f6c626172)

Query Highlighter
=================

[](#query-highlighter)

Description
-----------

[](#description)

CodeIgniter 4 Database Debug Toolbar Query Highlighter.

Table of contents
-----------------

[](#table-of-contents)

- [Requirement](#requirement)
- [Installation](#installation)
- [Configuration](#configuration) (Optional)
- [ScreenShot](#screenshot)
- [Credit](#credit)

Requirement
-----------

[](#requirement)

- [Codeigniter 4](https://github.com/codeigniter4/CodeIgniter4)
- [Highlight.php](https://github.com/scrivo/highlight.php)

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

[](#installation)

Install library via composer:

```
composer require nfaiz/dbtoolbar

```

Query Highlighter is located at DbQueries tab (Debug Toolbar)

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

[](#configuration)

### Remove Default Database Tab

[](#remove-default-database-tab)

1. Open and comment `Database::class` from `$collectors` property in `app/Config/Toolbar.php`.

```
public array $collectors = [
    // Database::class,
];
```

2. Open and comment `Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');` in `app/Config/Events.php`.

```
if (CI_DEBUG && ! is_cli()) {
  // Events::on('DBQuery', 'CodeIgniter\Debug\Toolbar\Collectors\Database::collect');
  Services::toolbar()->respond();
}
```

### Modify Settings.

[](#modify-settings)

Open and add properties below in `app/Config/Toolbar.php` accordingly.

```
/**
 * -------------------------------------------------------------
 * Disable DbToolbar query Highlighter
 * -------------------------------------------------------------
 *
 * To disable DbToolbar query highlighter, change value to true
 *
 * @var bool
 */
public bool $dbToolbarDisable = false;

/**
 * -------------------------------------------------------------
 * DbToolbar Theme
 * -------------------------------------------------------------
 *
 * Configuration for light and dark mode SQL Syntax Highlighter.
 * Refer https://github.com/scrivo/highlight.php/tree/master/src/Highlight/styles or
 * use \HighlightUtilities\getAvailableStyleSheets(); for available stylesheets.
 *
 * @var array
 */
public array $dbToolbarTheme = [
    'light' => 'atom-one-light',
    'dark'  => 'atom-one-dark'
];

/**
 * -------------------------------------------------------------
 * DbToolbar View
 * -------------------------------------------------------------
 *
 * To override DbToolbar SQL Syntax Highlighter view.
 *
 * @var array
 */
public string $dbToolbarTpl = 'Nfaiz\DbToolbar\Views\database.tpl';

/**
 * -------------------------------------------------------------
 * Bottom Margin Between Diplayed Query in Toolbar
 * -------------------------------------------------------------
 *
 * Value in px
 *
 * @var int
 */
public int $dbToolbarMarginBottom = 4;

/**
 * -------------------------------------------------------------
 * Log Queries
 * -------------------------------------------------------------
 *
 * Please set threshold to minimum 7 at app/Config/Logger.php
 * Logs can be found at ROOTPATH/writable/logs
 *
 * @var boolean
 */
public bool $dbToolbarLogger = false;
```

#### Custom Syntax Highlighter view.

[](#custom-syntax-highlighter-view)

Open `app/Config/Toolbar.php` and add/edit template view file using `$dbToolbarTpl` property.
You can create your own view and you change it accordingly. For Example `public $dbToolbarTpl = dbtoolbar/database;`

Views/dbtoolbar/database.php.

```
{! hlstyle !}

            Time
            Query String

    {queries}

            {duration}
            {trace-file}{! sql !}

            {trace}
                {index}{file}
                {function}
            {/trace}

    {/queries}

```

Screenshot
----------

[](#screenshot)

### Default Database Toolbar

[](#default-database-toolbar)

- Light

[![Light mode](https://user-images.githubusercontent.com/1330109/193412805-a923b570-a4b1-47e6-956c-3f9f97e8c2d8.png)](https://user-images.githubusercontent.com/1330109/193412805-a923b570-a4b1-47e6-956c-3f9f97e8c2d8.png)

- Dark

[![Dark mode](https://user-images.githubusercontent.com/1330109/193412939-b132801a-a639-4d1e-a57e-c2df1d628a6d.png)](https://user-images.githubusercontent.com/1330109/193412939-b132801a-a639-4d1e-a57e-c2df1d628a6d.png)

### Using DbToolbar

[](#using-dbtoolbar)

- Light

[![Light mode](https://user-images.githubusercontent.com/1330109/193412867-83603790-0c44-402b-b790-4f3d6576c412.png)](https://user-images.githubusercontent.com/1330109/193412867-83603790-0c44-402b-b790-4f3d6576c412.png)

- Dark

[![Dark mode](https://user-images.githubusercontent.com/1330109/193412970-faa3896e-8425-44a5-961e-ca9e553fecd9.png)](https://user-images.githubusercontent.com/1330109/193412970-faa3896e-8425-44a5-961e-ca9e553fecd9.png)

Credit
------

[](#credit)

- Inspired by this [pull request](https://github.com/codeigniter4/CodeIgniter4/pull/3515)

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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 ~100 days

Recently: every ~209 days

Total

11

Last Release

754d ago

Major Versions

v0.9.8 → v1.0.02023-12-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/8e60dcc2e275d40f209a301e76730c4ade96dead7878dd4d6483ac1d01a67d84?d=identicon)[nfaiz](/maintainers/nfaiz)

---

Top Contributors

[![nfaiz](https://avatars.githubusercontent.com/u/1330109?v=4)](https://github.com/nfaiz "nfaiz (61 commits)")

---

Tags

debugtoolbardatabasesqlcodeignitersyntaxcodeigniter4

### Embed Badge

![Health badge](/badges/nfaiz-dbtoolbar/health.svg)

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ifsnop/mysqldump-php

PHP version of mysqldump cli that comes with MySQL

1.3k5.5M69](/packages/ifsnop-mysqldump-php)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[tatter/relations

Entity relationships for CodeIgniter 4

9022.3k1](/packages/tatter-relations)[tatter/schemas

Database schema management, for CodeIgniter 4

2328.5k1](/packages/tatter-schemas)

PHPackages © 2026

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