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

Generator Laravel Package

popo/generator

popo/generator scaffolds Plain Old PHP Object (POPO) classes from your database tables, reducing boilerplate and helping Laravel developers build a simple, maintainable data layer.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What it actually is. popo/generator is a build-time code generator: it reads a YAML schema and emits plain PHP classes (POPOs/DTOs). Critically, it is not a runtime dependency — it does not sit in the request path, does not register a service provider in the hot loop, and the artifacts it produces are framework-agnostic PHP. This materially lowers the blast radius of adopting it, and it also means the tool is replaceable: worst case, you keep the generated classes and drop the tool.

Architecture fit. Good fit for teams practicing explicit boundary modeling (hexagonal/clean architecture, CQRS read models, API request/response contracts) where DTOs are currently hand-written and repetitive. The generated output has zero coupling to Laravel or to the generator itself, which is the right property. The architectural cost is that you introduce a second source of truth: the YAML becomes a schema of record, and the PHP becomes derived. That is a governance commitment, not a technical one, and it is where most adoptions of this class of tool fail.

Integration feasibility. Low. It is a Composer package installable under require-dev, invoked via CLI or a thin Artisan wrapper, writing into a target namespace. There is no migration, no database surface, no middleware, no config publishing to speak of. A spike is measurable in hours. The integration risk is almost entirely in convention (naming, namespaces, where generated files live, how they are excluded from or included in static analysis) rather than in wiring.

Technical risk. The dominant risk is maturity, not capability:

  • Community signal is weak. 20 stars, 0 dependents, single maintainer. No ecosystem validation, no third-party battle-testing, no evidence of production usage at scale.
  • Metadata anomaly. The stated last release (2026-07-22) is in the future relative to any normal evaluation window. Treat the supplied metadata as unreliable and verify the actual Packagist state, tag history, and commit cadence before any commitment.
  • Unknown type-system fidelity. For a DTO generator, the whole value proposition is faithful type mapping. Unverified: PHP 8.2/8.3/8.4 support, readonly properties and constructor promotion, native enums, backed enums, union/intersection types, nullable handling, nested DTOs, typed collections (array<int, Foo> vs. untyped array), and default values.
  • Unknown output determinism. Idempotent, stable, diffable output is table stakes. If regeneration reshuffles property order or whitespace, every run produces noise and the CI drift gate becomes unusable.
  • No visible security posture or test coverage in the summary. For a dev-only tool the security surface is small, but supply-chain hygiene (maintainer account, 2FA, release signing) still matters for anything in require-dev in a regulated codebase.

Key questions to resolve before a go decision.

  1. Which PHP versions and language features are supported, and does it emit readonly/promoted constructors and native enums?
  2. Is generation deterministic and idempotent across runs and across machines?
  3. How are nested structures, collections, unions, and nullability represented?
  4. Is the output templating extensible (custom stubs) or hard-coded?
  5. What is the test suite coverage, and is there a CI pipeline in the repo?
  6. What is the maintainer's stated support window and deprecation policy?
  7. Does it validate the YAML schema, and how does it fail on a malformed or partially-versioned schema?
  8. Is there any Laravel-specific integration, or is it strictly a generic PHP tool?

Integration Approach

Stack fit. Reasonable for a Laravel codebase, with one important caveat: it overlaps heavily with spatie/laravel-data, which is mature, widely adopted, and provides runtime validation, casting, and transformation on top of DTOs. If the team already uses laravel-data, popo/generator adds marginal value — you would be generating classes that a richer library already scaffolds. The genuine niche is teams that specifically want dependency-free POPOs with no runtime library attached, or teams generating DTOs for non-Laravel consumers (SDK clients, shared contract packages) where pulling in a framework helper is undesirable.

Placement. Install under require-dev. Emit into a dedicated, clearly-named directory (e.g. app/Data/Generated or a packages/contracts path) that is excluded from hand-editing by convention and annotated with a "generated — do not edit" header. Keep the YAML schema checked into the repo alongside the code it produces so the derivation is reviewable in the same PR.

Migration path. Do not retrofit the existing DTO surface. Start with a bounded spike:

  1. Pick one bounded context with 3–5 existing hand-written DTOs.
  2. Author the equivalent YAML and generate.
  3. Diff generated output against the hand-written classes and score parity: property names, types, nullability, constructor shape, fromArray/toArray helpers (likely absent — plan for that gap).
  4. Measure what you would lose (validation, casting, hydration ergonomics) and what you would gain (consistency, less boilerplate, schema as documentation).

Only expand if parity is acceptable and the team accepts the schema-governance overhead.

Compatibility and CI gates. Pin the version explicitly; do not float. Add a CI step that runs generation and asserts git diff --exit-code so drift between YAML and PHP fails the build rather than silently accumulating. Run the generator's output through the same static analysis baseline (PHPStan/Psalm) as the rest of the app so type-fidelity gaps surface immediately.

Sequencing.

  1. Vendor/license/SBOM audit and Packagist reality check (stars, tags, last commit, open issues).
  2. Timeboxed spike in a branch with a written parity report.
  3. Decision gate: adopt, fork-and-own, or reject.
  4. If adopt: CI drift gate, output conventions doc, generator version pin.
  5. Roll out per bounded context, not org-wide.
  6. Maintain an explicit exit plan: because output is plain PHP, the fallback is to freeze generated files, delete the YAML, and continue hand-maintaining — a low-cost unwind that should be documented up front.

Operational Impact

Maintenance. The tool itself is small, but adoption transfers a durable maintenance obligation: you now own the YAML schema, the generation pipeline, and the review process for both. Generator upgrades are the sharp edge — if output templates change between versions, a patch bump can produce a repository-wide diff that is functionally a no-op but unreviewable. Budget for deliberate, batched regeneration rather than continuous upgrades.

Support. No vendor, no SLA, negligible community. Support is self-support. Mitigations: pin the version, vendor or fork the package internally, and confirm the MIT license permits the fork (it does). Treat "we may have to fork this" as a planning assumption rather than a contingency.

Scaling. Technically it scales without concern — it is a build step, and build steps are cheap. The scaling constraint is organizational: as more teams contribute to a shared YAML schema set, you need ownership, review rules, backwards-compatibility discipline, and a versioning scheme for the schema itself. Left ungoverned, the YAML quietly becomes an undocumented internal DSL with no owner, which is a worse outcome than the hand-written boilerplate it replaced.

Failure modes to plan for.

  • Silent drift — code and schema diverge because generation is manual. Mitigated by the CI diff gate.
  • Non-deterministic output — noisy diffs erode trust and cause reviewers to rubber-stamp regeneration PRs.
  • Type-fidelity gaps — the generator flattens a union or collection to array/mixed, static analysis passes, and a runtime type error reaches production.
  • Abandonment — maintainer stops shipping; a PHP minor upgrade breaks generation. Mitigated by fork readiness and the freeze-and-own exit plan.
  • Leakage into public API — generated classes become the contract consumed by other services or SDK clients, making future schema changes a breaking-change exercise.
  • Scope creep — teams start hand-editing generated files to "just fix one thing," after which the schema is a lie.

Ramp-up. Shallow for individual engineers: YAML plus generated PHP is immediately legible, and the onboarding question is only "where did this class come from?" — answered by a header comment and a short README section. Realistic estimates: roughly 1–2 engineer-days for the spike and parity report, and about one sprint to institutionalize (CI gate, conventions, generation script, rollback runbook). The ongoing tax is the review discipline on regeneration PRs and periodic schema stewardship, which should be assigned to a named owner before rollout rather than after.

Recommendation. Conditional adoption, scoped narrowly. Worth a spike for greenfield DTO scaffolding in one or two bounded contexts where framework-free plain-PHP data structures are an explicit goal. Not justified for retrofitting an existing DTO surface, not justified if spatie/laravel-data is already in the stack, and not justifiable at all until the PHP-version support, type fidelity, and output determinism questions are answered with evidence from the actual repository rather than the package summary.

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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package