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

Eloquent Model Generator Laravel Package

rjacobsen/eloquent-model-generator

Generate Eloquent models directly from your database schema. This Laravel package inspects existing tables and scaffolds model classes with fillable fields and column metadata, cutting boilerplate when working with legacy or evolving databases.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit This is a dev-time scaffolding utility, not a runtime library. It introspects the database and emits Eloquent model classes, so its only legitimate architectural position is in require-dev, invoked once (or occasionally) by an engineer, with its output committed to the repository. It has no business in a production dependency graph, a request path, or a CI/CD pipeline. The package targets Laravel 5 (roughly the 2015–2018 era), which means the architecture fit is limited to legacy monoliths or as a one-shot bootstrap against an inherited schema.

Integration feasibility Low-to-moderate. Adoption signals are effectively zero: no stars, score 0, zero dependents. That is not an automatic rejection for a small scaffolding tool, but it does mean there is no community-validation layer, no evidence of PHP/Laravel version compatibility beyond the 5.x line, and no visible test suite or CI. The practical route is to treat the source as a reference implementation: fork or vendor it, pin it, and verify Composer constraints against the target PHP version. Expect doctrine/dbal (or equivalent introspection layer) to be the first incompatibility, since its major versions churn and Laravel's own schema builder has moved on considerably.

Technical risk High, concentrated in three areas:

  • Schema-to-code fidelity. Naive generators typically miss or mis-handle foreign keys (no belongsTo/hasMany inversion), pivot tables, polymorphic relations, composite keys, soft deletes, JSON/enum/geometry column types, and non-id primary keys. Every generated model becomes a manual review task, which erodes the time savings that justified the tool.
  • Destructiveness. Generators in this class commonly overwrite existing files. Running against a database with hand-tuned models is a data-loss-equivalent event for source code unless file-existence guards are confirmed.
  • Abandonment. No maintainer activity, no security advisory channel, no upgrade path. Any defect found is owned entirely by us.

Key questions

  1. Does it infer relationships from foreign keys, or emit flat models with $fillable/$table only?
  2. Is generation non-destructive (skip-if-exists) or overwrite-by-default?
  3. What are the exact composer.json constraints on PHP, Laravel, and the DBAL dependency?
  4. Which databases and schema features are exercised — MySQL only, or Postgres/SQLite too; are views, schemas, and non-public tables handled?
  5. What is the license, and is the codebase small enough (likely a handful of classes) to fork and own cheaply?
  6. How does it behave on tables that are clearly not models (jobs, failed_jobs, migrations, pivot tables)?

Integration Approach

Stack fit Only fits Laravel 5.x / PHP 7.x targets, or as an offline generator pointed at a legacy database from a modern Laravel project. It does not fit Laravel 10/11/12 as a live dependency. The realistic framing for a TPM is build-vs-buy: this capability is already served by maintained alternatives — reliese/laravel for DB-first model generation, kitloong/laravel-migrations-generator for the reverse direction, and laravel-shift/blueprint for schema-first generation. A zero-signal package is a hard sell against any of those unless the schema is quirky enough that the maintained options fail.

Migration path Position it as a one-shot bootstrap, not a standing dependency:

  1. Generate models in a scratch branch against a schema-only database copy.
  2. Commit the generated output as a reviewed baseline.
  3. Remove the dev dependency (or vendor the ~few classes internally) so no future install or audit inherits the abandonment risk.
  4. If repeat use is genuinely needed, promote to an internal fork under our own Composer namespace and versioning.

Compatibility Verify PHP constraint satisfaction before anything else; --ignore-platform-reqs should be treated as a stop signal, not a workaround. Confirm PSR-4 namespace mapping and output path are configurable, and that the DBAL version required by the package does not conflict with the one Laravel's own schema tooling expects. Check that generated code passes the project's static analysis and coding-standard gates — generated code that fails CI is worse than no code.

Sequencing Audit target stack versions → fork/vendor and pin → dry-run generation on a schema copy → human review of relations, casts, fillables, and table exclusions → commit baseline → strip the dependency → gate any regeneration behind a manual, documented procedure rather than automation.

Operational Impact

Maintenance Effectively 100% ours from day one. Zero dependents and no upstream activity mean no bug fixes, no PHP 8.x compatibility patches, and no Laravel upgrade treadmill support. TPM should budget explicit engineering ownership for the fork, or accept the tool as disposable single-use scaffolding — a defensible trade for a small class count, indefensible if the team starts depending on it for schema-change workflows.

Support No vendor, no maintainer SLA, no security disclosure process. Dependency scanners will flag it as unmaintained; that finding should be pre-empted in the risk register rather than discovered in an audit. Internal documentation of "why this exists and when it dies" is mandatory.

Scaling Runtime scaling is a non-issue — it executes at development time. The scaling concern is organizational: the tool has no schema-change story. Re-running it after migrations produces either a destructive overwrite or a manual three-way merge across dozens of models, and that cost grows linearly with table count and super-linearly with hand-tuning per model. Past roughly a few dozen tables, the review burden exceeds the generation benefit.

Failure modes

  • Silent overwrite of hand-written models and their business logic.
  • Wrong or missing relationship methods, discovered late as N+1 queries or runtime RelationNotFoundException.
  • Column type mismatches (JSON, enum, decimal precision, timestamps) producing subtle casting bugs.
  • Crashes on schema edge cases — views, non-public schemas, composite keys, tables without primary keys.
  • Dev dependency leaking into a production build or Docker image, expanding attack surface for zero benefit.
  • Generated code failing static analysis or breaking the build on commit.

Ramp-up Low for the command itself — an Artisan invocation with a config file; an engineer is productive in under an hour. High for the real work: reviewing generated models against domain intent, and standing up and maintaining an internal fork. TPM recommendation: allow it strictly as a throwaway bootstrap in a legacy-adoption scenario, require a named owner and a written removal date, and default to a maintained alternative for anything greenfield.

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.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel