pugx/generator-bundle
PUGXGeneratorBundle is a Symfony bundle that scaffolds complete CRUD interfaces from Doctrine entities, generating controllers, forms, templates, and routes with pagination, filtering, and customizable templates to speed up admin and backend development.
This is a Symfony bundle, not a Laravel package — the Laravel framing is a mismatch. It extends sensio/generator-bundle to scaffold CRUD (controller + form + views + routing) for Doctrine entities. If you are in a Laravel codebase, stop here; there is no Laravel integration, no service provider, and no artisan command.
Assuming a legacy Symfony 2.3–3.x app (the only versions this supported):
Install alongside the generator bundle:
composer require --dev pugx/generator-bundle
composer require --dev sensio/generator-bundle
Enable both bundles in app/AppKernel.php (dev/test env only):
if (in_array($this->getEnvironment(), ['dev', 'test'])) {
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new PUGX\GeneratorBundle\PUGXGeneratorBundle();
}
Confirm commands register:
app/console list pugx
First use case: generate a full CRUD for an existing Doctrine entity:
app/console generate:pugx:crud \
--entity=AcmeBlogBundle:Post \
--route-prefix=post \
--with-write
Where to look first:
Command/ — the actual generate:pugx:crud command and its options.Resources/skeleton/ — the Twig/controller/form templates you will inevitably override.Generator/ — the CRUD generator logic that wraps Sensio's generator.Standard CRUD workflow. Entity first (doctrine:generate:entity), then generate:pugx:crud. The bundle assumes a Doctrine ORM entity with an id and sensible getters/setters; it derives form fields from Doctrine column types.
Option-driven variants. Typical day-to-day flags:
--with-write to include create/edit/delete actions and templates, otherwise read-only listings.--route-prefix=post to namespace routes (post_index, post_show, ...).--format=yml|xml|annotation to match the project's routing style.--overwrite when regenerating after entity changes (see gotchas).--no-interaction for scripted/CI generation.Template override pattern. Don't edit files in vendor/. Override the bundle's skeleton by placing your own under app/Resources/PUGXGeneratorBundle/skeleton/crud/.... This is the supported extension point and the way teams standardize on their own Bootstrap/AdminLTE markup, base controller class, and service wiring.
Post-generation integration. The generated controller is plain Symfony — expect to:
$em = $this->getDoctrine()->getManager() boilerplate with injected services if the project uses constructor injection.Type form class for a project form type.Extending rather than forking. Subclass the generator or write a thin wrapper command that calls the PUGX command with a fixed option set, then applies your own post-processing (CS fixer, renaming, namespace fixes). This keeps upgrades possible and encodes team conventions.
CI usage. Only run generation locally and commit the output; do not invoke generators in deploy pipelines against an archived, unmaintained dependency.
php artisan make:model -mcr plus packages like laravel-generator / blueprint — PUGXGeneratorBundle has zero Laravel applicability.--overwrite regenerates controller/templates wholesale; any manual edits are lost. Keep generated code in its own commit and re-apply customizations, or override templates instead.Type before trusting it.--route-prefix explicitly to avoid clashes and inconsistent naming.pugx_generator config mostly toggles template options; do not expect behavior knobs for controller structure. Extension means template overrides and generator subclassing.-vvv; failures usually come from missing entity metadata (wrong bundle notation Bundle:Entity), unmapped fields, or a missing sensio/generator-bundle. Confirm app/console doctrine:mapping:info sees the entity first.require-dev and registered only in dev/test, so production container compilation doesn't depend on archived code.symfony/maker-bundle (make:crud, make:entity, make:form), which covers the same scaffolding use case with active support.How can I help you explore Laravel packages today?