rafidalridwan / laravel-db-client
Lightweight database client for Laravel
Package info
github.com/rafidalridwan/laravel-db-client
Language:Blade
pkg:composer/rafidalridwan/laravel-db-client
v1.0.1
2025-12-31 10:13 UTC
Requires
- php: >=8.1
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
This package is not auto-updated.
Last update: 2026-02-26 09:51:17 UTC
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




