Download the PHP package lukawar/lah-inspector without Composer

On this page you can find all versions of the php package lukawar/lah-inspector. 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 lah-inspector

lukawar/lah-inspector

Bridges a Laravel application to lah-cli / the laravel-api-helper VS Code extension. It captures the SQL queries executed during a request — with exact timings, separated bindings and the source file:line — and streams them to the locally running lah-cli sidecar, which forwards them to the editor panel.

This is the Full mode counterpart to lah-cli's standalone general_log capture (Lite mode). It is local/development only and disables itself in production.


Capture modes at a glance

Mode Requires What you get
Core nothing Route listing, sending requests, viewing responses. Always works.
Lite lah-cli + MySQL general_log Queries captured from the DB log. No bindings, no file:line, time-window correlation, misses prepared statements.
Full lah-cli + this package Exact QueryExecuted timings, masked bindings, source file:line, request-id correlation.

The VS Code panel auto-detects the active mode and shows a banner + install hints when a higher tier is available but not installed. You never need this package for the core plugin to work — it only unlocks the richer Queries/Models detail.


How it works

  1. The plugin sets an X-Lah-Request-Id header on every request it sends.
  2. CaptureMiddleware announces the package to lah-cli once per process, then activates the request-scoped Inspector for that id.
  3. DB::listen records every QueryExecuted (sql, exact time, bindings, caller file:line).
  4. On terminate() the batch is POSTed to {ingest_url}/ingest/queries.

Correlation is by request id (not a time window), so it stays exact even under concurrent traffic.


Installation

One command installs both. This package depends on lukawar/lah-cli, so requiring it also pulls the sidecar binary into vendor/bin/lah-cli — you do not install lah-cli separately.

A. From Packagist (when published)

This resolves lukawar/lah-inspector and lukawar/lah-cli in one shot. The CLI ships prebuilt binaries for macOS/Linux (amd64/arm64) with a shim that auto-selects your platform, exposed as vendor/bin/lah-cli.

B. Local path repository (development / unpublished)

If you have the package source on disk (e.g. while developing it), point Composer at it with a path repository. In the Laravel app's composer.json:

Then:

With symlink: true, Composer links vendor/lukawar/lah-inspector to your source dir, so edits take effect immediately. (Under php-fpm with OPcache enabled you may need to restart the fpm process to pick up changes.)

Configure the environment

Add to the app's .env:

Capture runs only when LAH_ENABLED=true and the app is not in the production environment.

Running Laravel in Docker (important)

ingest_url defaults to http://127.0.0.1:7331. Inside a container, 127.0.0.1 is the container itself, not your host — so if lah-cli runs on the host (the usual setup), the hello/queries POSTs go nowhere and the panel silently stays in Lite mode, prompting you to "add lukawar/lah-inspector" even though it is already installed.

Point the package at the host gateway instead. In the app's .env:

On Docker Desktop (macOS/Windows) host.docker.internal already resolves to the host. On Linux, add it explicitly to the php service in docker-compose.yml:

Verify from inside the container:

If it still says not reachable, the container cannot reach the host on port 7331 — check the extra_hosts entry and that lah-cli is running in the project root. See Troubleshooting.


Verify the wiring

Example output:

Then send a request through the laravel-api-helper panel: the Queries tab should switch to the Full banner and show per-query timing, bindings and a clickable 📄 file:line.


Configuration

Publish the config to tweak defaults:

Key Default Purpose
enabled false Master switch (LAH_ENABLED).
ingest_url http://127.0.0.1:7331 lah-cli base URL.
header X-Lah-Request-Id Correlation header.
capture_bindings true Send bindings (masked) alongside SQL.
capture_caller true Resolve source file:line via backtrace.
max_queries 500 Cap per request.
mask password, token, secret, … Columns whose col = ? bindings are masked.
timeout_ms 300 Upper bound on the ingest POST.

Each key also reads a matching LAH_* env var (LAH_INGEST_URL, LAH_HEADER, LAH_CAPTURE_BINDINGS, LAH_CAPTURE_CALLER, LAH_MAX_QUERIES, LAH_TIMEOUT_MS).


Security


Troubleshooting

Symptom Likely cause / fix
Queries tab stays in Lite (despite the package being installed) Package not loaded, LAH_ENABLED off, or — most commonly in Docker — ingest_url points at 127.0.0.1 from inside the container. Run php artisan lah:status; set LAH_INGEST_URL=http://host.docker.internal:7331; clear config cache (php artisan config:clear).
lah-cli: not reachable lah-cli not running, wrong ingest_url, or (in Docker) missing host.docker.internal — see Running Laravel in Docker.
Edits to package don't apply OPcache under php-fpm — restart the fpm process / container.
file:line points at vendor code The first non-internal frame is used; Caller skips Laravel/Illuminate/Symfony and this package's own dir.
No queries at all Confirm the plugin is sending the X-Lah-Request-Id header and that the route actually hits the DB.

Limitations (v1)

License

MIT


All versions of lah-inspector with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
lukawar/lah-cli Version ^1.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 lukawar/lah-inspector contains the following files

Loading the files please wait ...