Download the PHP package mahmoud-mhamed/laravel-dblens without Composer

On this page you can find all versions of the php package mahmoud-mhamed/laravel-dblens. 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-dblens

laravel-dblens

A phpMyAdmin-style database browser & manager for Laravel — built with Blade, Tailwind and Alpine.js. Browse, search, edit rows, alter schema, import/export, and run SQL — all from a clean dashboard mounted in your app.

⚠️ DbLens is a powerful tool. By default it is enabled only in the local environment. Read the Security section before turning it on in production.


Features

Browsing

Row CRUD

Schema editing

SQL editor

Database objects

ER diagram

Multi-tenancy (stancl/tenancy)

Setup: register DbLens routes inside the tenant context. In routes/tenant.php:

Set DBLENS_DEFAULT_CONNECTION=tenant (or use the connections.default config) so DbLens opens the tenant DB by default.

Activity log integration

Export & Import

Artisan commands

Security

Supported drivers


Installation

Requirements

1. Install the package

The service provider is auto-registered via Laravel's package discovery — no manual config/app.php edits required.

2. Run the installer

This single command publishes both the config and the views (equivalent to running the two vendor:publish commands below).

To overwrite already-published files:

3. Visit DbLens

You'll be redirected to the default connection's database page. In local it works out of the box; for other environments, see Authorization.


Publishing assets

dblens:install is a wrapper around Laravel's vendor:publish. You can also publish individual tags:

Publish the config only

Creates config/dblens.php. Edit it to change route prefix, gate, throttle, allowed connections, masked columns, etc. See Configuration.

Publish the views only

Creates resources/views/vendor/dblens/. Laravel will load views from this folder instead of the package's bundled views, so you can customize the look freely.

Re-publish (overwrite local copies)

⚠️ --force overwrites your local edits in config/dblens.php and resources/views/vendor/dblens/. Commit before running it.

Stop using the published views

Delete the resources/views/vendor/dblens/ folder — Laravel will fall back to the package's bundled views automatically.

Environment variables (.env)

The most common knobs are exposed as env vars so you can toggle per-environment without editing the config:

After changing any of these, clear the config cache if you cache config in production:

Uninstalling


Configuration

Open config/dblens.php. The defaults are sane for local dev; the keys you most likely want to tweak:

Environment variables

Var Default Description
DBLENS_ENABLE_LOCAL true Enable in local
DBLENS_ENABLE_PRODUCTION false Enable in production
DBLENS_READONLY false Global write lock
DBLENS_PATH dblens URL prefix
DBLENS_DOMAIN Mount on a subdomain
DBLENS_DEFAULT_CONNECTION DB_CONNECTION Pre-selected connection
DBLENS_SQL_WRITES false Allow INSERT/UPDATE/DELETE/ALTER in the SQL editor
DBLENS_PASSWORD Dashboard password (bcrypt hash recommended). When unset, the password gate is skipped.
DBLENS_LOG_ACTIVITY auto Activity log integration: true / false / auto (auto-enable when spatie/laravel-activitylog is installed and its table exists)
DBLENS_LOG_CONNECTION DB connection used by activity log writes (defaults to spatie's activitylog.database_connection)
DBLENS_TENANCY auto Multi-tenancy integration: true / false / auto (auto-detect stancl/tenancy)

Authorization

DbLens has three independent gates you can combine:

  1. Route middleware (config('dblens.viewer.middleware')) — runs first. Defaults to ['web', 'auth'], so anonymous visitors are bounced to your app's login page. Drop 'auth' for an open dashboard, or replace it with 'auth:admin' / a custom middleware.
  2. Dashboard password (config('dblens.viewer.password')) — when set, visitors must enter this password on /dblens/login before they can use the dashboard. Stored as a session flag.
  3. Laravel Gate (config('dblens.gate')) — optional final check. When set, the gate ability is checked on every request.

1. Middleware

The default already gates the dashboard behind Laravel's regular auth — no changes needed if you're using the standard auth middleware:

Customize per your stack:

2. Dashboard password (recommended for production)

Generate a bcrypt hash:

Add to .env:

Plain strings also work (compared in constant time) — but a hash is safer because it never appears in logs or stack traces in plaintext form. Set the var to empty to disable the password gate.

When the password is set, the middleware redirects every unauthenticated request to /dblens/login. After a correct submission, a session flag (dblens_authenticated) is set and the user can use the dashboard until they log out or the session expires.

A Logout button automatically appears in the topbar when the password is configured.

3. Laravel Gate (advanced)

Override the default gate in your AuthServiceProvider (or any service provider's boot()):

The package's default viewDbLens gate only allows access in the local environment. Setting config('dblens.gate') to null disables the gate check entirely (you can rely on middleware + password instead).

Putting it together — typical setups

Environment middleware password gate
Local dev (just me) ['web'] null 'viewDbLens' (auto-allows local)
Staging (shared) ['web', 'auth'] (default) bcrypt hash null
Production (gated) ['web', 'auth'] (default) bcrypt hash 'viewDbLens' w/ is_admin check
Public internet do not run

URL map

All routes are mounted under config('dblens.viewer.path') (default /dblens) and are named under the dblens. prefix.

Method URI Name
GET / POST /login dblens.login · dblens.login.submit
POST /logout dblens.logout
GET / dblens.dashboard
GET /{conn} dblens.database.show
GET /{conn}/search?q=… dblens.search
GET /{conn}/sql · POST /{conn}/sql dblens.sql.show · dblens.sql.run
GET /{conn}/export dblens.database.export
GET /{conn}/import · POST /{conn}/import dblens.database.import.form · dblens.database.import
GET /{conn}/create-table · POST dblens.table.create.form · dblens.table.create
GET /{conn}/t/{table} dblens.table.browse
GET /{conn}/t/{table}/structure dblens.table.structure
GET /{conn}/t/{table}/info dblens.table.info
GET /{conn}/t/{table}/export?format=sql\|csv\|json dblens.table.export
GET /{conn}/t/{table}/import · POST /.../import-csv dblens.table.import.form · dblens.table.import.csv
POST/PUT/DELETE /{conn}/t/{table}/columns/{column?} dblens.column.add/modify/rename/drop
POST/DELETE /{conn}/t/{table}/indexes/{index?} dblens.index.add/drop
POST /{conn}/t/{table}/foreign-keys dblens.fk.add
DELETE /{conn}/t/{table}/fk/{fk} dblens.table.fk.drop
POST /{conn}/t/{table}/truncate dblens.table.truncate
POST /{conn}/t/{table}/rename dblens.table.rename
DELETE /{conn}/t/{table} dblens.table.drop
GET /{conn}/t/{table}/r/{rowKey} dblens.row.show
GET/PUT /{conn}/t/{table}/r/{rowKey}/edit dblens.row.edit/update
DELETE /{conn}/t/{table}/r/{rowKey} dblens.row.destroy
GET/POST /{conn}/t/{table}/create dblens.row.create/store
POST /{conn}/t/{table}/bulk-delete dblens.row.bulk-destroy

Row keys are URL-encoded JSON for composite primary keys (e.g. {"a":1,"b":2}) or a plain value for single-column PKs.


Architecture

Driver implementations isolate vendor-specific SQL. Adding a new driver = implementing DriverInterface.


Caveats per driver

MySQL / MariaDB: Full feature support.

PostgreSQL:

SQLite:


Roadmap


License

MIT © Mahmoud Mhamed


All versions of laravel-dblens with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/console Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^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 mahmoud-mhamed/laravel-dblens contains the following files

Loading the files please wait ...