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

Php Code Generator Laravel Package

gossi/php-code-generator

A lightweight PHP library for generating PHP code programmatically. Build classes, methods, properties, namespaces, and docblocks through a fluent API, then render valid source files for scaffolding, code generation, and automation workflows.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for developer tooling: This package positions well as a “buy” (adopt) decision for teams that need programmable Laravel/PHP code generation — scaffolding, boilerplate CRUD, DTOs, handlers — rather than writing and maintaining an internal generator.
  • Roadmap for internal developer productivity: The new profile + enableFormatting options signal a move toward standardized, tool-integrated output. If your roadmap includes “generated code must pass CI linting/formatting without manual touch-ups,” this release makes that a candidate path — but the feature is explicitly experimental, so it should be treated as a spike, not a committed platform bet yet.
  • Whether to generate-and-commit vs. generate-at-build-time: The formatting capability (using gossi/php-code-formatter) materially affects whether generated code is reviewable in PRs. If generated artifacts are committed, formatting quality becomes a product-visible concern; if generated at build time, this is lower priority.
  • API stability / dependency risk budgeting: The PhpFunction deprecation (see #35) plus continued pre-1.0 releases means any decision to adopt should include a migration-cost line item on the roadmap — a product decision, not just an engineering one.
  • Quality baseline for generated output: The fixes for FQCN interface parsing (#51) and trait ordering (#52) reduce “generate, then hand-fix” friction — relevant if you’re measuring developer time saved as the success metric for adoption.

When to Consider This Package

Consider adopting when:

  • You need programmatic, configurable code generation inside a Laravel codebase and want to avoid maintaining a bespoke generator.
  • Your team is comfortable with a pre-1.0 / beta API and can pin versions and absorb breaking changes on your own cadence.
  • Code output correctness (interfaces, traits, FQCNs) is important to you — the recent fixes show active maintenance in exactly those areas.
  • You are willing to run a timeboxed spike on enableFormatting rather than depend on it in a critical path.

Look elsewhere when:

  • You require a stable public API with SemVer guarantees — the PhpFunction deprecation and experimental formatter are clear signals of churn ahead.
  • Your existing code relies heavily on PhpFunction and you cannot absorb a migration.
  • You need guaranteed, supported code formatting as part of the generation pipeline; enableFormatting is labeled “very experimental,” so treat it as prototype-grade.
  • You are evaluating for a production-critical, long-lived workflow where third-party dependency updates (and their regressions) would create unacceptable operational risk.

Immediate action for current/future adopters: pin to an exact version, track issue #35 for the PhpFunction migration path, and avoid committing to the formatter’s output contract until it exits experimental status.

How to Pitch It (Stakeholders)

To executives: This is a low-cost, open-source Laravel package that can reduce repetitive coding by generating boilerplate programmatically. The latest beta adds configurable output formatting (still experimental) and fixes real correctness bugs, indicating active maintenance. Recommendation: fund a short, timeboxed evaluation rather than a broad rollout — the package is pre-1.0, so the primary risk is rework from API changes, not licensing cost.

To engineering: Adopt behind a pinned version in a spike branch. Two things to plan for: (1) PhpFunction is now deprecated (issue #35) — inventory any current usage and budget a migration; (2) enableFormatting depends on gossi/php-code-formatter and is explicitly experimental — do not wire it into CI as a hard gate yet. The interface-FQCN and trait-ordering fixes improve generated-output correctness, which reduces post-generation cleanup. Validate output against your own fixtures before trusting it in a shared generator.

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.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource