Download the PHP package tusharkhan/db-error-explainer-laravel without Composer

On this page you can find all versions of the php package tusharkhan/db-error-explainer-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 db-error-explainer-laravel

DB Error Explainer for Laravel

Latest Version Downloads License: MIT

Explains Laravel database errors in plain language, with a suggested fix, right on the error page.

Works with MySQL / MariaDB, PostgreSQL and SQLite connections.

Requirements

Installation

The service provider and the DbExplainer facade are auto-discovered.

What you get

On the Ignition error page

When a QueryException reaches the error page, Ignition shows a "Database error explained" solution with:

Nothing to configure; it is enabled when Ignition is installed.

In code

explain() uses the connection the exception came from. It returns null for non-database exceptions, unsupported drivers (e.g. sqlsrv) or when disabled. It never throws.

Connection failures (wrong password, server down) are explained too, without trying to reconnect.

From the command line

Paste an error from storage/logs/laravel.log (the (Connection: ..., SQL: ...) part can stay):

Turn the suggested fix into a migration you can review and run:

The stub runs the SQL with DB::unprepared(). The command warns when the fix lists alternatives or contains placeholders like your_table to replace first.

Both commands read the message only; they never run the failing query. Options:

Option
--connection= Connection the error came from (decides MySQL / PostgreSQL / SQLite rules). Default connection when omitted
--no-schema Don't connect to look up table and column details
--sqlstate=, --code= Fill these in when the pasted text doesn't start with SQLSTATE[...]
--json db:explain only: print the full diagnosis as JSON
--path= db:fix-stub only: directory for the migration

In your logs

Set DB_EXPLAINER_LOG=true and every reported QueryException also writes a Database error diagnosed entry with the error type and explanation.

Configuration

Key Env Default
enabled DB_EXPLAINER_ENABLED true Turn everything off
allow_introspection DB_EXPLAINER_INTROSPECTION true Read-only schema lookups for more specific explanations
redact_sensitive_data DB_EXPLAINER_REDACT true Hide password, token, api_key, ... values
log DB_EXPLAINER_LOG false Log an explanation for each reported database error
log_channel DB_EXPLAINER_LOG_CHANNEL null Channel for those entries (default channel when null)
ignition DB_EXPLAINER_IGNITION true Add the solution to the Ignition error page
custom_rules [] Your own rules, same array format as the built-in ones

License

MIT. See LICENSE.


All versions of db-error-explainer-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/console Version ^12.0|^13.0
illuminate/database Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
tusharkhan/db-error-explainer-core Version ^1.0
tusharkhan/db-error-explainer-lib 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 tusharkhan/db-error-explainer-laravel contains the following files

Loading the files please wait ...