ekosuprianto96/laravel-visual-migrator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ekosuprianto96/laravel-visual-migrator

Composer 安装命令:

composer require ekosuprianto96/laravel-visual-migrator

包简介

Visual Schema Designer for Laravel Migrations (powered by Mongo Diagram)

README 文档

README

Current version: 2.6.1

Latest Version on Packagist Software License

Laravel Visual Migrator is a powerful visual database schema design tool integrated directly into your Laravel application. Model your tables, fields, and relationships visually and transform them into Laravel migration files instantly.

Key Features

  • 🎨 Visual Architecture Builder: Design your database schema using a highly interactive and intuitive diagram interface powered by Vue Flow.
  • 🔄 Bidirectional Synchronization:
    • Import: Automatically scan your database/migrations folder and visualize your existing tables.
    • Export: Generate clean, PSR-compliant Laravel migration PHP files from your visual design.
  • 🛡️ Draft & Persistence System: Added tables (Drafts) are preserved in your browser's local storage until you officially save them to migrations, preventing work loss on refresh.
  • Layout Stability: Smart merging logic ensures that your custom node positions are preserved even after backend synchronization.
  • Real-time Change Detection: Automatically detects when migration files are modified on the server and notifies you to sync.
  • Table Selection: Choose specifically which tables you want to export or sync, giving you granular control over your codebase.

Efficiency & Performance

  • Optimized Network Traffic: Uses debounced requests for layout saving and throttled polling for change detection.
  • Tab Visibility Awareness: Polling automatically pauses when the browser tab is inactive to save system resources.
  • Lightweight Metadata: Relationship and layout data are stored efficiently in a single JSON file within your migrations folder.

Installation

Install the package via composer:

composer require ekosuprianto96/laravel-visual-migrator

Publish and setup the package automatically:

php artisan visual-migrator:install

This command will publish assets, configuration, and offers to run the database migrations for you.

Important

If you choose not to run migrations during installation, make sure to run them manually afterwards:

php artisan migrate

How to Access

After installation, the Visual Migrator dashboard is available at:

http://your-app.test/visual-migrator

Note

By default, the dashboard is only accessible in the local environment. You can change the URL path and middleware in the config/visual-migrator.php file.

Useful Commands

Reset Metadata

If you need to reset all visual layout data (node positions), you can use the refresh command:

php artisan visual-migrator:refresh

Cleanup Orphaned Data

If you delete migration files manually, you can clean up the orphaned visual metadata from the database:

php artisan visual-migrator:cleanup

Testing

Run the unit tests using PHPUnit:

cd packages/laravel
composer install
./vendor/bin/phpunit

Configuration

The configuration file is located at config/visual-migrator.php. You can customize the following options:

return [
    /**
     * The URL path where the visual migrator dashboard will be accessible.
     * Default: 'visual-migrator'
     */
    'path' => 'visual-migrator',

    /**
     * The middleware applied to the visual migrator routes.
     * Usually 'web' is sufficient for local development.
     */
    'middleware' => ['web'],

    /**
     * List of migration tables to be ignored by the visual migrator.
     * These tables will not be parsed or displayed in the diagram dashboard.
     * Perfect for hiding Laravel system/boilerplate tables.
     */
    'ignore_migrations' => [
        'users', 'password_reset_tokens', 'failed_jobs', 
        'personal_access_tokens', 'cache', 'jobs', 
        'job_batches', 'sessions',
    ],
];

Important

For security reasons, the dashboard is only accessible in the local environment by default.

Why Use Laravel Visual Migrator?

  1. Speed up Prototyping: Stop writing migrations by hand. Drag, drop, and click to build your core architecture in minutes.
  2. Visual Documentation: Your diagram is your living documentation. New team members can understand the database structure at a glance.
  3. Reduced Human Error: Ensure foreign keys and data types are consistent across tables without worrying about syntax errors.
  4. Non-Destructive: It works alongside your existing migrations. You can selectively sync only what you need.

Future Roadmap

  • Visual Seeders: Generate factory and seeder data directly from the diagram.
  • Export to Laravel Blueprint: Support for the popular Laravel Blueprint syntax.
  • Collaborative Mode: Real-time collaborative design for teams.
  • Reverse Engineering Support: Advanced parsing for complex raw SQL dumps.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

ekosuprianto96/laravel-visual-migrator 适用场景与选型建议

ekosuprianto96/laravel-visual-migrator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 4, 最近一次更新时间为 2026 年 02 月 21 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 ekosuprianto96/laravel-visual-migrator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ekosuprianto96/laravel-visual-migrator 我们能提供哪些服务?
定制开发 / 二次开发

基于 ekosuprianto96/laravel-visual-migrator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 34
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-21