hisee/db-digram
Composer 安装命令:
composer require hisee/db-digram
包简介
Laravel package to visualize and manage database schema with an interactive DB diagram UI.
README 文档
README
DB Digram
Interactive database diagram builder for Laravel.
This package provides a visual UI to inspect your schema, create/update/delete tables and columns, and export SQL.
Requirements
- PHP 8.2+
- Laravel 11 or 12
Installation
Use this command to install it
composer require hisee/db-digram
Service Provider
Laravel package auto-discovery is enabled, so no manual provider registration is required.
If your app has auto-discovery disabled, register the provider manually in bootstrap/providers.php:
Hussain\DBDigram\DbDigramServiceProvider::class,
Publish Config
After installation, publish the package config file:
php artisan vendor:publish --tag=db-digram-config
This creates config/db-digram.php in your app where you can enable/disable the package:
return [ 'enabled' => true, 'auth' => [ 'enabled' => false, 'email' => '', 'password' => '', 'realm' => 'DB Diagram Access', ], ];
You can also configure these values in .env:
DB_DIGRAM_AUTH_ENABLED=true DB_DIGRAM_AUTH_EMAIL=admin@example.com DB_DIGRAM_AUTH_PASSWORD=secret-password DB_DIGRAM_AUTH_REALM="DB Diagram Login"
When auth is enabled, the page shows a login modal before the diagram is displayed.
Usage
Start your app and open:
- /diagram
Main capabilities in the UI:
- View current database schema
- Add table
- Edit table name and table columns
- Delete table
- Add/edit/delete columns
- Define foreign key relationships
- Zoom controls and auto zoom
- Export schema SQL
- Toggle dark and light mode
Important Notes
- Schema actions create migration files in your host app under database/migrations.
- Table and column changes are applied by running migrations internally.
- Use carefully in production environments.
- Keep backups before destructive schema changes.
统计信息
- 总下载量: 665
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-14

