rehmanafzal/dbmanager
Composer 安装命令:
composer require rehmanafzal/dbmanager
包简介
A powerful database manager for Laravel — supports SQLite & MySQL with a clean UI
README 文档
README
A powerful, zero-config database manager for Laravel applications. Works with SQLite and MySQL / MariaDB automatically — install it and visit /dbmanager.
Think phpMyAdmin, but built into your Laravel app.
Requirements
| Requirement | Version |
|---|---|
| PHP | 8.1 or higher |
| Laravel | 10.x, 11.x, or 12.x |
| SQLite | 3.25+ |
| MySQL / MariaDB | 5.7+ / 10.3+ |
Installation
composer require rehmanafzal/dbmanager
The package auto-discovers via Laravel's package discovery. No service provider registration, no route files to edit, no migrations to run.
Open your browser:
http://your-app.test/dbmanager
Default Login
| Field | Value |
|---|---|
| Username | admin |
| Password | secret |
Change these immediately after first login via the Settings page.
Configuration
Option 1 — Environment variables (recommended)
Add to your .env file:
DBMANAGER_USERNAME=admin DBMANAGER_PASSWORD=secret
Option 2 — Publish the config file
php artisan vendor:publish --tag=dbmanager-config
This creates config/dbmanager.php:
return [ 'username' => env('DBMANAGER_USERNAME', 'admin'), 'password' => env('DBMANAGER_PASSWORD', 'secret'), 'prefix' => 'dbmanager', 'session_key' => 'dbmanager_authenticated', ];
Option 3 — Change credentials from the UI
Go to /dbmanager/settings → Change Login Credentials. The new credentials are written directly to your .env file.
Features
Dashboard
- Stats: total tables, total rows, database size, driver
- Full table list with row counts
- One-click browse, structure, export, drop per table
- Backup and restore the entire database
Browse & Data Management
Inline cell editing (like phpMyAdmin)
- Double-click any cell to edit it in place
- Smart input types based on column type:
DATETIME/TIMESTAMP→ native datetime pickerDATE→ date pickerTIME→ time pickerENUM(...)→ dropdown with all enum valuesTINYINT(1)/BOOLEAN→ dropdown: NULL / 0 (false) / 1 (true)INT/DECIMAL/FLOAT→ number inputTEXT/BLOB/JSON→ textarea- Everything else → text input
- Press Enter or click ✓ Save to save via AJAX
- Press Escape to cancel
- Green toast on success, red on error
Bulk row actions
- Checkbox on every row + Select All
- Edit Selected Rows → opens a full bulk edit page showing all selected rows as editable forms with smart inputs per column type
- Delete Selected → deletes all selected rows in one query with confirmation
Other data features
- Paginated table data (25 / 50 / 100 / 250 rows per page)
- Search across all columns simultaneously
- Sort by any column (ascending / descending)
- Insert row, edit row, delete row
- Import CSV into any table
- Export table as CSV or SQL dump
- Truncate table
Create Table
Full phpMyAdmin-style column definition grid:
| Column | Description |
|---|---|
| Name | Column name |
| Type | Grouped dropdown: Numeric, String, Date/Time, Binary, Other |
| Length / Values | Auto-disabled for types that don't need it. Shows 'a','b','c' hint for ENUM/SET |
| Default | None / NULL / Custom value / CURRENT_TIMESTAMP / Empty string |
| Not Null | Checkbox |
| Unique | Checkbox (creates a UNIQUE index) |
| Auto Inc | Checkbox (MySQL: AUTO_INCREMENT PRIMARY KEY) |
| PK | Checkbox (marks as PRIMARY KEY) |
- Set the number of columns and click Go to build the grid
- Click + Add Column to add more rows
id,created_at,updated_atare added automatically
Table Structure
- View all columns: name, type, length, default, not null, key
- Edit column — rename, change type, default, not null via modal
- Rename column — dedicated rename modal
- Drop column — with confirmation
- Bulk drop — select multiple columns and drop at once
- Add multiple columns at once — same grid as Create Table (Name, Type, Length, Default, Not Null, Unique, Auto Inc, Position)
- Position: At End / At Beginning / After [column]
- Indexes — list all, add (INDEX / UNIQUE / FULLTEXT), drop
- Foreign Keys (MySQL only) — list all, add with ON DELETE / ON UPDATE rules, drop
SQL Query Editor
- Full SQL editor with dark code theme
Ctrl + Enterto execute- Results displayed in a sortable table
- Export query results as CSV
- Quick-fill buttons for common queries (users, products, orders, list tables)
Import & Convert
Upload a database file and it auto-detects the format and converts if needed:
| Upload | Current DB | Action |
|---|---|---|
.sqlite file |
MySQL | SQLite → MySQL (types auto-converted) |
.sqlite file |
SQLite | Direct import |
MySQL .sql dump |
SQLite | MySQL syntax → SQLite syntax |
MySQL .sql dump |
MySQL | Direct import |
SQLite .sql dump |
MySQL | SQLite syntax → MySQL syntax |
Two import modes:
- Merge — insert new rows, skip existing ones (by primary key)
- Replace — insert or replace rows with matching primary key
Authentication & Settings
- Session-based login — no database users required
- Credentials stored in
.env - Change username and password from the built-in Settings page
- Settings page shows: driver, database name, host (MySQL), Laravel version, PHP version
All Routes
All routes register automatically under /dbmanager. Nothing to add to routes/web.php.
| Method | URL | Description |
|---|---|---|
| GET | /dbmanager/login |
Login page |
| GET | /dbmanager/logout |
Sign out |
| GET | /dbmanager |
Dashboard |
| GET | /dbmanager/settings |
Settings & credentials |
| POST | /dbmanager/settings/update |
Save credentials |
| GET | /dbmanager/sql |
SQL query editor |
| GET | /dbmanager/create-table |
Create table form |
| POST | /dbmanager/create-table |
Save new table |
| DELETE | /dbmanager/drop-table/{table} |
Drop a table |
| GET | /dbmanager/import |
Import & convert page |
| POST | /dbmanager/import/convert |
Run import |
| GET | /dbmanager/backup |
Download database backup |
| POST | /dbmanager/restore |
Restore from backup |
| GET | /dbmanager/table/{table} |
Browse table rows |
| GET | /dbmanager/table/{table}/structure |
Table structure |
| POST | /dbmanager/table/{table}/add-column |
Add columns |
| POST | /dbmanager/table/{table}/rename-column |
Rename a column |
| POST | /dbmanager/table/{table}/modify-column |
Edit column definition |
| DELETE | /dbmanager/table/{table}/drop-column |
Drop a column |
| DELETE | /dbmanager/table/{table}/bulk-drop-columns |
Drop multiple columns |
| POST | /dbmanager/table/{table}/add-index |
Add an index |
| DELETE | /dbmanager/table/{table}/drop-index |
Drop an index |
| POST | /dbmanager/table/{table}/add-foreign-key |
Add a foreign key |
| DELETE | /dbmanager/table/{table}/drop-foreign-key |
Drop a foreign key |
| GET | /dbmanager/table/{table}/create |
Insert row form |
| POST | /dbmanager/table/{table}/store |
Save new row |
| GET | /dbmanager/table/{table}/edit/{id} |
Edit row form |
| PUT | /dbmanager/table/{table}/update/{id} |
Save row changes |
| DELETE | /dbmanager/table/{table}/delete/{id} |
Delete a row |
| POST | /dbmanager/table/{table}/inline-update |
Inline cell update (AJAX) |
| GET | /dbmanager/table/{table}/bulk-edit-page |
Bulk edit page |
| POST | /dbmanager/table/{table}/bulk-update |
Save bulk edit |
| DELETE | /dbmanager/table/{table}/bulk-delete |
Bulk delete rows |
| DELETE | /dbmanager/table/{table}/truncate |
Truncate table |
| GET | /dbmanager/table/{table}/export/csv |
Export as CSV |
| GET | /dbmanager/table/{table}/export/sql |
Export as SQL |
| POST | /dbmanager/table/{table}/import/csv |
Import CSV |
Database Support Matrix
| Feature | SQLite | MySQL / MariaDB |
|---|---|---|
| Browse & inline edit | ✅ | ✅ |
| Add / drop columns | ✅ | ✅ |
| Rename column | ✅ (3.25+) | ✅ |
| Modify column type | ⚠️ Rename only | ✅ Full CHANGE |
| Column position (FIRST / AFTER) | ❌ | ✅ |
| Auto Increment | ✅ | ✅ |
| Indexes | ✅ | ✅ |
| FULLTEXT index | ❌ | ✅ |
| Foreign keys | ❌ | ✅ |
| Backup | .sqlite download |
.sql dump |
| Restore | .sqlite upload |
.sql upload |
| Import from SQLite file | ✅ | ✅ |
| Import from SQL dump | ✅ | ✅ |
Publish Views
To customize the UI:
php artisan vendor:publish --tag=dbmanager-views
Views are copied to resources/views/vendor/dbmanager/.
Upgrade
composer update rehmanafzal/dbmanager php artisan view:clear php artisan config:clear
Security
This package is designed for development and internal tools.
- Do not expose
/dbmanageron a public production server without additional protection - Always change the default
admin/secretcredentials - Consider IP restriction or wrapping routes in your app's
authmiddleware
License
MIT — free to use in personal and commercial projects.
rehmanafzal/dbmanager 适用场景与选型建议
rehmanafzal/dbmanager 是一款 基于 Blade 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 04 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「admin」 「mysql」 「manager」 「sqlite」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rehmanafzal/dbmanager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rehmanafzal/dbmanager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rehmanafzal/dbmanager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
2lenet/EasyAdminPlusBundle
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Analysis module for finding problematical shop data.
A PSR-7 compatible library for making CRUD API endpoints
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 23
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-08