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 Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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):

  1. Install alongside the generator bundle:

    composer require --dev pugx/generator-bundle
    composer require --dev sensio/generator-bundle
    
  2. 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();
    }
    
  3. Confirm commands register:

    app/console list pugx
    
  4. 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.

Implementation Patterns

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:

  • Replace the generated $em = $this->getDoctrine()->getManager() boilerplate with injected services if the project uses constructor injection.
  • Move generated templates into your app's template hierarchy and point the controller at them.
  • Adjust generated routes into the project's routing file (or import the generated one).
  • Swap the generated 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.

Gotchas and Tips

  • Archived / unmaintained. No PHP 7.2+ or Symfony 4+ support. Installing it on a modern Symfony app will fail dependency resolution or break at runtime. Treat it as legacy-only.
  • Not Laravel. If you arrived here from a Laravel search, the correct analogue is php artisan make:model -mcr plus packages like laravel-generator / blueprint — PUGXGeneratorBundle has zero Laravel applicability.
  • Hard dependency on SensioGeneratorBundle. That bundle is itself deprecated/removed in Symfony 4. PUGX will not work without it, and it will not work on Symfony versions that dropped it.
  • Overwrite behavior is destructive. --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.
  • Doctrine assumptions. Non-standard mappings (embedded objects, custom types, associations without inversed sides) produce broken forms or missing fields. Inspect the generated Type before trusting it.
  • Pluralization/route naming quirks. Route prefixes are derived from the entity name if not supplied; set --route-prefix explicitly to avoid clashes and inconsistent naming.
  • Generated templates are era-appropriate. The skeleton markup is old Bootstrap-era Twig. Expect to rewrite it immediately for anything current.
  • Config surface is small. pugx_generator config mostly toggles template options; do not expect behavior knobs for controller structure. Extension means template overrides and generator subclassing.
  • Debugging generation failures. Run with -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.
  • Dev-only install. Keep both generator bundles in require-dev and registered only in dev/test, so production container compilation doesn't depend on archived code.
  • Long-term recommendation. For a maintained replacement on modern Symfony, use symfony/maker-bundle (make:crud, make:entity, make:form), which covers the same scaffolding use case with active support.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
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
cgv/localized-resource