Download the PHP package evgeny-korovin/laravel-query-logger without Composer

On this page you can find all versions of the php package evgeny-korovin/laravel-query-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-query-logger

Laravel Query Logger

evgeny-korovin/laravel-query-logger is a Laravel package that automatically records executed SQL queries and helps you find slow parts of your application.

Русская версия

Features

Requirements

Installation

Install the package through Composer:

Laravel will automatically discover the package service provider. Migrations are loaded automatically and will run with the regular migration command:

The query list includes Tailwind CSS through its official CDN script, so it works without adding npm packages or changing the application's frontend build.

After installation, open:

For example, if your application is running at http://localhost, the interface will be available at http://localhost/sql-queries.

Configuration

Publish the configuration file if needed:

The configuration file will be located at config/query-logger.php.

Query execution time thresholds can be configured using environment variables:

Queries up to the warning threshold use the regular row color, queries between the warning and critical thresholds are highlighted in yellow, and queries above the critical threshold are highlighted in red.

AI Recommendations

The AI advice button sends the SQL and EXPLAIN result to the selected AI provider. The package supports providers with an OpenAI-compatible API. You can configure the URL, API key, model, and additional headers for each provider.

OpenCode is used by default:

To use OpenAI, set:

The model can be overridden for a specific provider with OPENCODE_MODEL or OPENAI_MODEL. The list of providers, their URLs, and additional headers are configured in config/query-logger.php:

If QUERY_LOGGER_AI_MODEL is not set, the selected provider's model is used. If the selected provider's API key is not configured, the package's other features continue to work, but AI recommendations will be unavailable.

Routes

The package registers routes with the web middleware:

Method URI Purpose
GET /sql-queries list and search queries
DELETE /sql-queries delete all records
GET /sql-queries/{queryLog}/explain get EXPLAIN
POST /sql-queries/{queryLog}/ai-advice get AI recommendations

Routes are not restricted by authorization by default. In production, make sure to protect the interface and delete operations with your own middleware or restrict access at the web server level.

What Is Not Logged

The package ignores queries against the query_logs table to prevent recursion, as well as EXPLAIN queries executed by the interface itself.

License

This package is distributed under the MIT license.

Telegram

Русская версия


All versions of laravel-query-logger with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/database Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/routing Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
illuminate/view Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package evgeny-korovin/laravel-query-logger contains the following files

Loading the files please wait ...