Welcome Guest, Not a member yet? Register   Sign In
Database Debug Toolbar SQL Highlighter
#1

(This post was last modified: 07-25-2021, 12:27 AM by nfaiz.)

Hi,

I want to share my project for this weekend. . Moved to here
Basically it modify sql syntax highlighter for database debug toolbar using Highlight.php library.

Current

[Image: Wu7HKOI.png]

Dark

[Image: qwLfFtQ.png]

After using the library

[Image: eQ4sUwJ.png]

Dark

[Image: 2Nuo0nX.png]

Installation and setup

  1. Install the library using composer
    Code:
    composer require nfaiz/dbtoolbar

  2. Run this command to setup the library
    Code:
    php spark dbtoolbar:config


Configuration file: app/Config/DbToolbar.php

For more info please visit here. Moved to here

Thank you.
Reply
#2

Excellent! Thanks for sharing. Screenshots look great, I’ll peek into the code when I’m on desktop
Reply
#3

(This post was last modified: 11-15-2021, 08:10 AM by nfaiz. Edit Reason: update )

Installation and setup

  1. Install the
    Library using composer
    Code:
    composer require nfaiz/dbtoolbar


  2. Open app/Config/Toolbar.php

    Replace default database collector class Database::class to \Nfaiz\DbToolbar\Collectors\Database::class


    public $collectors = [
        Timers::class,
        Database::class,
        \Nfaiz\DbToolbar\Collectors\Database::class,
        Logs::class,
        Views::class,
        // \CodeIgniter\Debug\Toolbar\Collectors\Cache::class,
        Files::class,
        Routes::class,
        Events::class,
    ];


  3. Open app/Config/Events.php

    Replace default query collector to Events::on('DBQuery', 'Nfaiz\DbToolbar\Collectors\Database::collect');


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

    Refresh page to see the result.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB