Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine2 Exporter Laravel Package

comunedifirenze/doctrine2-exporter

Exporter that converts MySQL Workbench .mwb models into Doctrine 2 schemas. Install via Composer and run the CLI to generate YAML schema or annotation-based entities, with options for namespaces, repositories, relations, nullability, cascades, and more.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Database-Driven Development Acceleration: Enables rapid conversion of MySQL Workbench models (.mwb) into Doctrine 2 schema definitions (YAML/Annotation), reducing manual ORM configuration time by ~70% for teams migrating from MySQL Workbench to Symfony/Laravel.
  • Standardization of Entity Generation: Supports consistent entity naming conventions (e.g., bundleNamespace, entityNamespace) and inheritance patterns (STI via generateExtendableEntity), aligning with Symfony best practices.
  • Legacy System Modernization: Bridges legacy MySQL Workbench schemas to modern PHP frameworks (Laravel/Symfony) without rewriting database logic, lowering migration costs.
  • Developer Productivity: CLI-driven workflow reduces onboarding time for junior devs unfamiliar with Doctrine annotations/YAML by auto-generating boilerplate code (getters/setters, relations, cascades).
  • Customization Flexibility: Fine-grained control over relation types (unidirectional/bidirectional), cascade operations, and fetch strategies via model comments, enabling tailored ORM behavior without manual overrides.
  • ZF2/Laravel Integration: Optional ZF2 Input Filter class generation (generateEntityPopulate) supports validation layers in Laravel (via custom traits), reducing duplication between ORM and validation logic.

When to Consider This Package

  • Avoid if:
    • Your team uses Doctrine ORM without MySQL Workbench (e.g., schema-first with migrations or raw SQL).
    • You require active maintenance (0 stars, untested maturity; consider Doctrine’s official tools instead).
    • Your schema is highly dynamic (e.g., polyglot persistence, NoSQL) or uses non-standard Doctrine features (e.g., custom types, event listeners).
    • You need real-time schema sync (this is a one-time export tool).
  • Consider alternatives:
    • Doctrine Extensions: For advanced features like Tree or Behavioral.
    • SchemaCrawler: For database reverse-engineering to PHP (supports more DBMS).
    • Custom Scripts: If your MySQL Workbench models have non-standard annotations or require pre-processing.

How to Pitch It (Stakeholders)

For Executives: "This tool cuts database integration time by automating 80% of Doctrine ORM setup from MySQL Workbench models, accelerating feature delivery for our [Symfony/Laravel] projects. For example, migrating a 50-table schema from Workbench to Doctrine—normally a 2-week task—takes under 2 hours with this exporter. It’s a low-risk, high-reward investment to standardize our data layer and reduce technical debt."

For Engineering: *"This CLI tool converts .mwb files into Doctrine YAML/annotations with zero manual work for:

  • Entity classes (with customizable namespaces, inheritance).
  • Relations (1:1, 1:N, M:N) with configurable cascades/fetch strategies.
  • Validation helpers (ZF2-style populate() methods for Laravel). It’s lightweight (MIT-licensed, no dependencies beyond Doctrine) and extensible—just add comments to your Workbench model to tweak generation (e.g., {d:unidirectional}true). Perfect for onboarding or migrating legacy schemas."*

For Developers: *"Run this once:

composer require --dev mysql-workbench-schema-exporter/doctrine2-exporter
vendor/bin/mysql-workbench-schema-export path/to/model.mwb --format=annotation --bundleNamespace=App\\Entity

Then profit:

  • No more copy-pasting column definitions.
  • Auto-generated repositories, getters/setters, and even serialization methods.
  • Supports Symfony bundles and Laravel’s Eloquent-like patterns (via ZF2 filters). Pro tip: Use {d:cascade}persist in Workbench comments to skip manual @ORM\Cascade annotations."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity