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
Code Generator Bundle

Code Generator Bundle Laravel Package

idci/code-generator-bundle

A Symfony bundle for generating PHP code from customizable templates. Define generators and templates, then produce classes, entities, or boilerplate through console commands or the service API. Configurable output and Symfony integration make it easy to automate repetitive code scaffolding.

View on GitHub
Deep Wiki
Context7

Symfony CodeGeneratorBundle

Frequently asked questions about Code Generator Bundle
Can I install idci/code-generator-bundle in a Laravel application?
No, not as a working integration. The package is a Symfony2 bundle that ships a Bundle subclass, a DependencyInjection extension, and Resources/config/services.xml container wiring, none of which has a loading path in Laravel. Composer may also refuse to install it because it pins Symfony 2.x and Doctrine 2.x components that conflict with the Symfony 6/7 components Laravel 10 and 11 already depend on. Treat it as a reference implementation to port, not a dependency to adopt.
Does idci/code-generator-bundle support Laravel 10 or Laravel 11?
It does not support any Laravel version. The bundle targets Symfony2, which reached end of life in 2018, and its PHP floor is likely 5.3 through 5.6. Laravel 10 and 11 require PHP 8.1 and 8.2 respectively, so the code will not even parse cleanly on a modern runtime. There is no maintained branch, CI, or compatibility shim for Laravel.
Why does composer require idci/code-generator-bundle fail with dependency conflicts?
The package pulls in Symfony 2.x and Doctrine 2.x constraints that clash with the Symfony 6/7 packages Laravel already resolves. Composer will either report an unsatisfiable dependency graph or try to downgrade your host framework, which is a non-starter for any maintained product. You can confirm the exact conflict by running composer why-not against the package name before attempting anything else.
How do I set up template-driven code generation in Laravel without this bundle?
Build a small CodeGenerator service behind an interface and resolve it in AppServiceProvider from a config/code-generator.php file that holds alphabet, length, and prefix settings. Use Laravel's filesystem and Blade or stub-replacement helpers to render templates into classes, config files, or boilerplate. Expose it through an Artisan command for console use and inject the service wherever generation is needed. This is roughly a one to two day story and gives you full ownership of the code.
How do I make generated code output customizable per project in Laravel?
Publish a config file with sensible defaults for namespaces, output paths, stub locations, and prefix or length rules, then let each project override it in its own config directory. Pass user-provided parameters through a small DTO or value object rather than an array so validation happens once at the boundary. Render templates with a stub replacer that understands placeholders like namespace and class name. This mirrors the bundle's customizable-output idea without the Symfony container assumptions.
Is idci/code-generator-bundle maintained and safe for production use?
It shows no meaningful trust signal: zero stars, zero dependents, no CI, and no peer review. Symfony2 has been end of life since 2018, so no security patch path exists and no CVE feed is watching the package. A supply-chain or security review will flag it immediately. Do not ship it to production.
How do I generate unique promo codes or invite codes in Laravel without duplicates?
Generate codes with random_int or Str::random using an explicit alphabet, then persist them through Eloquent with a unique index on the code column. Catch the duplicate-key exception and retry with a bounded loop of three to five attempts before failing loudly. Rely on the database constraint rather than an application-level already-used check, which races under concurrency. Use a CSPRNG and normalize case and collation so a1b2 and A1B2 cannot both exist.
Can I reuse the generation algorithm and templates from this bundle in a Laravel project?
Possibly, but only after an audit, and it is a rewrite rather than an integration. The surface area is likely one or two generator classes plus a Doctrine entity, and you must strip the bundle and Doctrine layers before any logic is reusable. Confirm the declared license, that generation uses a CSPRNG rather than mt_rand or uniqid, and what enforces uniqueness before copying anything. If all three check out, a plain PHP class wrapper is reasonable.
How do I test a code generator service in Laravel?
Bind your CodeGenerator interface to a fake or a real implementation in the test container and assert on rendered output using string or file assertions. Use Pest or PHPUnit data providers to cover parameter edge cases like empty prefixes, maximum lengths, and unusual alphabets. Add a feature test that hits the Artisan command and asserts the generated file exists with the expected contents. Include a concurrency-style test that simulates duplicate-key collisions to prove your retry loop terminates.
What are the best alternatives to idci/code-generator-bundle for Laravel developers?
For identifier-shaped codes use ramsey/uuid, and for short human-friendly codes use hidehalo/nanoid-php with a custom alphabet. Laravel's native Str::random and random_int helpers with your own alphabet cover most promo-code and invite-code cases without any dependency. For scaffolding templates specifically, a small in-house generator service is usually less work than retrofitting a Symfony2 bundle. All of these are maintained and compatible with current Laravel and PHP versions.
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.
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
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect