brybry/laravel-visual-schema
Composer 安装命令:
composer require brybry/laravel-visual-schema
包简介
A drag-and-drop visual database designer for Laravel with professional ERD design capabilities. Shared hosting compatible with no build process required.
关键字:
README 文档
README
A comprehensive drag-and-drop visual database designer for Laravel applications. Create beautiful ERD diagrams with tables, relationships, and export them as PDF or images.
Features
- 🎨 Drag & Drop Interface - Built with Alpine.js and Fabric.js (No build process required)
- 🧰 Professional Toolbox - Quick table creation, templates, and design tools
- 🔗 Visual Relationships - Draw connections between tables with smart routing
- 💾 Persistent Layouts - Save and reload your designs exactly as arranged
- 📤 Multiple Export Formats - PNG, SVG, and PDF export (grid-free exports)
- 🔐 Secure Access Control - Environment-based restrictions and middleware protection
- 📱 Responsive Design - Works on desktop, tablet, and mobile devices
- 🌙 Dark/Light Mode - Theme support with automatic grid adaptation
- ↩️ Undo/Redo System - Full action history with 50-step memory
- 🔍 Advanced Canvas - Zoom, pan, grid snapping, and alignment tools
- 📐 Alignment Tools - Professional layout with distribute and align functions
- ⚡ Quick Actions - Table templates (Users, Posts, Categories), keyboard shortcuts
- 🎯 Smart Grid System - Adjustable dot grid with snap-to-grid functionality
- 🚀 Laravel 12 Ready - Full compatibility with Laravel 10, 11, and 12
- 🏠 Shared Hosting Compatible - No Node.js, npm, or build processes required
- 📦 CDN-Powered Frontend - Uses Alpine.js and Fabric.js from CDN for zero compilation
Installation
Requirements
- PHP: 8.2 or higher
- Laravel: 10.x, 11.x, or 12.x
- Web Server: Apache, Nginx, or any server that supports Laravel
- Hosting: Compatible with shared hosting (cPanel, Plesk, etc.)
- No Node.js Required: Works without npm, webpack, or any JavaScript build tools
Install via Composer
composer require brybry/laravel-visual-schema
Publish Assets (Shared Hosting Compatible)
Publish the static CSS/JS files (no compilation needed):
php artisan vendor:publish --provider="BryBry\LaravelVisualSchema\LaravelVisualSchemaServiceProvider" --tag="assets"
Publish the configuration file:
php artisan vendor:publish --provider="BryBry\LaravelVisualSchema\LaravelVisualSchemaServiceProvider" --tag="config"
Publish views for customization (optional):
php artisan vendor:publish --provider="BryBry\LaravelVisualSchema\LaravelVisualSchemaServiceProvider" --tag="views"
For Shared Hosting Users
After publishing assets, simply upload your Laravel application via FTP. The package uses CDN libraries and requires no build process:
- ✅ Upload via FTP/SFTP
- ✅ No Node.js required
- ✅ No npm install needed
- ✅ No build commands
- ✅ Works on cPanel/Plesk
🎮 Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl + S |
Save schema |
Ctrl + Z |
Undo |
Ctrl + Y |
Redo |
Ctrl + D |
Duplicate selected object |
Ctrl + G |
Group selected objects |
Ctrl + U |
Ungroup selected objects |
Ctrl + T |
Add new table |
Ctrl + 0 |
Reset zoom to 100% |
Ctrl + + |
Zoom in |
Ctrl + - |
Zoom out |
Delete |
Delete selected object |
Enter |
Edit table name (when table selected) |
Space |
Fit canvas to window |
Escape |
Deselect all objects |
🔗 ERD Design Features
Interactive Relationship Drawing
- Point-and-Click Drawing: Click source table → click target table to create relationships
- Visual Feedback: Live preview while drawing relationships with mouse tracking
- Crow's Foot Notation: Professional ERD symbols (one-to-one, one-to-many, many-to-many)
- Smart Routing: Automatic relationship line routing around tables
Foreign Key Auto-Detection
- Convention-Based Detection: Automatically detects foreign key relationships from column names
- Smart Suggestions: Identifies
user_id→users.idpatterns and similar conventions - Bulk Relationship Creation: Apply all detected relationships with one click
- Visual Indicators: Clearly shows detected vs. manually created relationships
Relationship Management
- Relationship Types: One-to-One, One-to-Many, Many-to-Many with proper visual notation
- Edit Relationships: Modify relationship types and properties after creation
- Delete Relationships: Remove relationships individually or in bulk
- Relationship List: Sidebar panel showing all relationships with details
Professional ERD Tools
- Drawing Mode Toggle: Switch between normal editing and relationship drawing modes
- Relationship Toolbox: Dedicated tools for ERD-specific operations
- Visual Relationship Lines: Clean, professional lines with crow's foot endings
- Auto-Layout: Smart positioning to avoid overlapping relationship lines
🧰 Toolbox Features
Quick Add Tools
- One-Click Tables: Add tables with default Laravel structure
- Custom Tables: Quick input for table names
- Template Library: Pre-built tables (Users, Posts, Categories)
Alignment Tools
- Align Objects: Left, Right, Top, Bottom, Center
- Distribute: Even spacing horizontally or vertically
- Layer Control: Send to back/front, grouping
Canvas Tools
- Smart Grid: Adjustable dot grid (10-50px spacing)
- Snap to Grid: Automatic alignment assistance
- Grid Toggle: Show/hide grid overlay
- Zoom Controls: Precise zoom with percentage display
Technology Stack
Frontend (Zero Build Process):
- Alpine.js 3.13+ - Reactive JavaScript framework via CDN
- Fabric.js 5.3+ - Canvas manipulation library via CDN
- jsPDF 2.5+ - PDF export functionality via CDN
- Pure CSS - No preprocessing required
Backend:
- Laravel 10|11|12 - Full framework compatibility
- PHP 8.2+ - Modern PHP features
Hosting Compatibility:
- Shared Hosting - cPanel, Plesk, DirectAdmin
- VPS/Dedicated - Full server control
- Cloud Platforms - AWS, DigitalOcean, Linode
- FTP Upload - Traditional file upload supported
Usage
After installation, visit /schema-designer in your Laravel application (local environment only by default).
Creating ERD Relationships
-
Auto-Detection Method (Recommended):
- Click "Detect Foreign Keys" in the ERD Tools panel
- Review detected relationships in the sidebar
- Click "Apply All" to create all detected relationships at once
-
Manual Drawing Method:
- Click "Toggle Relationship Mode" to enter drawing mode
- Click on the source table (where the foreign key column is)
- Click on the target table (the referenced table)
- The relationship will be created automatically with proper notation
-
Managing Relationships:
- View all relationships in the right sidebar panel
- Edit relationship types (1:1, 1:M, M:M) using the dropdown
- Delete individual relationships using the "Remove" button
- Export your ERD diagrams with relationships included
Configuration
Edit config/schema-designer.php to customize:
- Access permissions
- Storage location
- Export settings
- Security middleware
Security
By default, the schema designer is only accessible in local environments. Configure additional security in the config file:
'enabled' => env('SCHEMA_DESIGNER_ENABLED', app()->environment('local')), 'middleware' => ['web', 'auth', 'role:admin'],
Export Formats
- PNG - High-quality raster image
- SVG - Vector graphics for scalability
- PDF - Print-ready document format
Requirements
- PHP 8.2+
- Laravel 10+, 11+, or 12+
- Node.js (for asset compilation)
License
The MIT License (MIT). Please see License File for more information.
brybry/laravel-visual-schema 适用场景与选型建议
brybry/laravel-visual-schema 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「schema」 「laravel」 「visual」 「Relationships」 「designer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 brybry/laravel-visual-schema 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 brybry/laravel-visual-schema 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 brybry/laravel-visual-schema 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
Extension for Opis JSON Schema
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
EAV modeling package for Eloquent and Laravel.
serialize Symfony Forms into JSON schema
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-06