Weave 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

Laravel Models Generator Laravel Package

axn/laravel-models-generator

Generate Eloquent models directly from your existing database schema. Laravel Models Generator inspects your tables and creates ready-to-use model classes with fillable fields, relationships, and more, making it easy to bootstrap new projects or reverse-engineer legacy databases.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Database-first vs. code-first workflow choice. This package assumes an existing schema is the source of truth and generates Eloquent models from it. That is the right call for brownfield/legacy products, internal tools over a vendor or ERP database, and reporting services — and a bad call for greenfield work where migrations should lead. Adopting it is effectively a decision to make the schema authoritative for at least the scaffolding phase.
  • Build vs. buy (really: build vs. adopt vs. fork). MIT-licensed and free, so the purchase decision is trivial — the real cost is ownership. With a small star count, near-zero dependents, and a repo recorded as archived in our original assessment, the honest framing is "adopt as a one-time accelerator, then own the output," not "add a dependency." The 8.0.0 tag shows at least periodic Laravel-compatibility maintenance; confirm current archive status before relying on it.
  • Which Laravel version the modernization targets. 8.0.0 requires Laravel 12+ and Doctrine DBAL 4+. That turns a tooling detail into a roadmap constraint: if the legacy app being ported is currently on Laravel 10/11, this release won't run there, and the older 7.x line is frozen. Decide the target framework version before committing to the codegen step, not after.
  • Time-to-first-value on brownfield migrations. For a team porting a legacy PHP/Java/.NET app onto Laravel, hand-writing 60–200 models with correct belongsTo/hasMany/belongsToMany relations and docblocks is days of low-value work. Codegen collapses that to an afternoon plus review, which materially shifts the roadmap for a modernization epic.
  • Scope decisions on schema size. Generated docblocks/property hints make a 150-table schema navigable in an IDE. This can change whether you decide to trim the schema up front or accept it wholesale — a genuine architecture-level tradeoff that usually gets decided by feel rather than data.
  • "Do we need a schema-introspection capability at all?" Adjacent needs — ERD generation, schema drift detection, test-fixture generation from production shape — can share the same Doctrine-based introspection foundation. Worth a spike before committing to three separate tools. Note the DBAL 4 floor also applies to anything we'd build on that shared layer.
  • De-risking a framework-standardization initiative. Cheap, reversible, dev-only. A useful probe to prove Laravel viability on a real schema before asking for a larger migration budget.

When to Consider This Package

Consider it when:

  • You have a mature, stable database schema you do not control the migrations for (legacy app, vendor product, data warehouse, read-replica reporting service).
  • You are on, or are willing to move to, Laravel 12+ and Doctrine DBAL 4+. This is now a hard prerequisite, not a preference. On Laravel ≤11 the only option is the frozen 7.x line.
  • Generation is one-time or occasional, run locally by a developer, with output committed and reviewed like any other code.
  • The work is internal tooling or non-critical path, where a stale generated file is an annoyance rather than an incident.
  • You have PHP/Laravel engineers who can read the source and are willing to fork it internally — the MIT license makes this legally clean, and at this size the codebase is auditable in an afternoon.
  • You need multi-database introspection (MySQL/Postgres/SQL Server/SQLite via Doctrine DBAL) rather than a single-driver solution.
  • You want customizable output — the template-driven design lets you match house style, add interfaces, or emit your own base-model conventions.

Look elsewhere — or budget to fork and maintain — when:

  • Maintenance guarantees matter. The repo has been recorded as archived, and 8.0.0 is a compatibility-only release: it removes support for older Laravel and DBAL, adds no features, and publishes no deprecation runway beyond the version bump. No security patches, no bug fixes, and no roadmap. If a future Laravel upgrade breaks it, that is your problem. This remains the single largest risk and should be an explicit, written acceptance, not a footnote.
  • You are pinned below Laravel 12 or DBAL 4. You would be adopting 7.x, which will never receive another fix. Either upgrade first or hand-write the models.
  • Generation must run in CI or on every deploy as part of a pipeline. An archived, breaking-version dev-dependency in a build path is a slow-motion outage.
  • You need more than models — factories, seeders, policies, form requests, resources, typed DTOs. Check the template surface carefully; scope creep here is where forks become permanent.
  • You're migrations-first or greenfield. The tool inverts your source of truth and will fight you.
  • You want community support, docs, or a hiring signal. Effectively zero adoption means no Stack Overflow answers, no blog posts, no one to ask. Your team is the community.
  • Schema churn is high. Regeneration diffs against hand-edited models create merge pain; the value proposition collapses when the schema moves weekly.

How to Pitch It (Stakeholders)

To executives: This is a free, MIT-licensed code generator that reads an existing database and produces Laravel model classes — the boilerplate layer between the database and the application. For a legacy-modernization effort it can compress a multi-day scaffolding task into hours, which is real schedule and cost avoidance on the critical path. The latest release (8.0.0) is housekeeping, not new capability: it drops support for older Laravel and database-abstraction versions, which tells us two things — the project is still alive enough to track framework releases, but it also means the tool only works on Laravel 12 and above, so it constrains rather than follows our platform choice. The caveat stays candid: minimal adoption and a history of being archived mean we treat this as a one-time accelerator, not a long-term dependency. We generate code once, commit it, and own it from that moment. No runtime risk, no vendor relationship, no license cost, and fully reversible — the worst case is we delete the generated files and write them by hand, which is where we'd be anyway. Recommendation: approve a time-boxed spike on one bounded slice of the schema, contingent on the target app running Laravel 12+, not a standing architectural commitment.

To engineering: Treat this as a dev-only tool in the same category as an IDE plugin or a scaffolder. Run it locally against a read-only connection, review the diff, commit the output, and then never regenerate blindly — the generated models become your code the moment they land. Pin the major version explicitly: 8.x requires Laravel 12 and DBAL 4, and 7.x is end-of-line, so if the host app is on an older Laravel you are choosing between an upgrade project and hand-written models. Do not put it in CI or any deploy path. If the spike shows the templates need heavy customization, that's the signal to fork early rather than fight the defaults. Also flag: the Doctrine DBAL introspection layer is the genuinely reusable part — if we later need ERDs or schema-drift checks, that same foundation is worth evaluating before we build or buy something new, and the DBAL 4 dependency will shape that decision too.

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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource