Download the PHP package jeytekdev/explain-lint-laravel without Composer

On this page you can find all versions of the php package jeytekdev/explain-lint-laravel. 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 explain-lint-laravel

jeytekdev/explain-lint-laravel

Laravel bridge for jeytekdev/explain-lint — re-runs EXPLAIN against every query your test suite executes, and fails the build on full table scans, lost indexes, filesort and temporary tables.

Install (2 minutes)

The service provider auto-discovers via extra.laravel.providers — nothing to register manually. It hooks DB::listen() and only captures queries while $app->runningUnitTests() is true (or EXPLAIN_LINT_FORCE=true), so there's no overhead outside your test suite.

Wire up the PHPUnit extension:

Run this from your project root (where composer.json/vendor/ live) — every path it touches (phpunit.xml, the new explain-lint.php) is resolved relative to the current working directory, not to vendor/bin/.

Or add it manually to phpunit.xml:

Set the connection driver to match your database in the generated explain-lint.php:

Then run your suite as usual — no other code changes needed:

Reading the report

A violation is printed as a block, grouped by test, with the info needed to act on it — including the fingerprint you'd copy into an allowlist entry:

Allowlisting a known-OK query

Two ways, both in explain-lint.php, both require a non-empty reason:

Optional: per-test assertions

If you'd rather assert explicitly inside a specific test instead of relying on suite-wide enforcement (or you're on a PHPUnit version predating the Extension/Event API), use the testing trait:

CI

Relying solely on the in-process exit(1) from the PHPUnit run is a single point of failure if anything in your pipeline swallows PHPUnit's exit code — run the check as a separate second step:

explain-lint:check needs a JUnit report to read, so enable it in config:

Troubleshooting

A table with very few rows still gets flagged as error. Table-size-based suppression (tiny/small tables never trigger scan rules) relies on information_schema.TABLES.TABLE_ROWS on MySQL, which is a cached estimate — on a freshly migrated test database it's often NULL until ANALYZE TABLE runs, and an unknown size is treated as "could be large" on purpose (so real regressions aren't silently hidden by a stale stat). If this shows up a lot on your test DB, either run ANALYZE TABLE <name> as part of your test setup, or allowlist the specific table/query.

Could not locate the Composer autoloader when running vendor/bin/explain-lint. If the package was installed via a path repository, vendor/jeytekdev/explain-lint is a symlink — this is resolved correctly as of the current release, but if you're on an older checkout, update jeytekdev/explain-lint.

Connection resolution. DB::listen() fires with the query's connectionName, matched against connections.<name> in your config, falling back to connections.default if there's no exact match — you don't need one entry per Laravel connection unless you actually want different thresholds per connection.

License

MIT


All versions of explain-lint-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
jeytekdev/explain-lint Version ^1.0
illuminate/database Version ^10.0 || ^11.0 || ^12.0
illuminate/support Version ^10.0 || ^11.0 || ^12.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 jeytekdev/explain-lint-laravel contains the following files

Loading the files please wait ...