rafidalridwan/laravel-db-client
最新稳定版本:v1.0.1
Composer 安装命令:
composer require rafidalridwan/laravel-db-client
包简介
Lightweight database client for Laravel
README 文档
README
A lightweight database client package for Laravel that provides a Blade UI to access your connected database, view tables, manage data, and run SQL queries.
Repository: rafidalridwan/laravel-db-client
Features
- 📊 View All Tables - Browse all database tables with row counts and column information
- 🔍 Table Data View - View table data with pagination
- ✏️ Add/Edit/Delete Rows - Full CRUD operations on table data
- 🔐 SQL Query Runner - Execute SQL queries with security checks
- 🛠️ Artisan Commands - Run Laravel Artisan commands through the UI
- 🔒 Security - Built-in SQL injection protection and read-only mode support
- 📱 Responsive UI - Modern, clean interface
Installation
- Install the package via Composer:
composer require rafidalridwan/laravel-db-client
The package is auto-discovered by Laravel.
- Publish assets:
php artisan vendor:publish --tag=dbclient
Usage
-
Navigate to
/dbclientin your browser (make sure you're authenticated if using auth middleware) -
Tables View - Lists all tables with row counts
- Click "View" to see table data
- View table structure in collapsible section
- Add, edit, or delete rows
-
SQL Query - Run custom SQL queries
- Type your query and click "Execute"
- Results are displayed in a table
- Execution time is shown
- Dangerous operations are blocked in read-only mode
-
Artisan - Run Laravel Artisan commands
- Select from allowed commands
- View command output
Security Features
- SQL Guard - Blocks dangerous SQL operations (DROP, TRUNCATE, ALTER, CREATE, etc.)
- Read-Only Mode - When enabled, only SELECT queries are allowed
- Table Name Sanitization - Prevents SQL injection through table names
- Middleware Protection - Routes are protected by configurable middleware
Routes
GET /dbclient- Tables listGET /dbclient/table/{table}- View table dataGET /dbclient/table/{table}/rows- Get paginated rows (JSON)GET /dbclient/table/{table}/row/{id}- Get single row (JSON)POST /dbclient/table/{table}/insert- Insert new rowPUT /dbclient/table/{table}/{id}/update- Update rowDELETE /dbclient/table/{table}/{id}/delete- Delete rowGET /dbclient/query- SQL query interfacePOST /dbclient/query/run- Execute SQL queryGET /dbclient/artisan- Artisan commands interfacePOST /dbclient/artisan/run- Run Artisan command
📸 Screenshots
📊 Tables Overview
🔍 Table Data View
🏗️ Table Structure
💻 SQL Query Runner
🛠 Artisan Commands
Requirements
- PHP >= 8.1
- Laravel >= 8.0
- jQuery (included via CDN in views)
License
MIT
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-31




