aldaflux / my-maker-bundle
maker bundle crud variation
Package info
github.com/AlDaFlux/MyMakerBundle
Type:symfony-bundle
pkg:composer/aldaflux/my-maker-bundle
Requires
- symfony/framework-bundle: >=6.4
- symfony/maker-bundle: >=1.65
Requires (Dev)
- syfony/maker-bundle: >=1.65
README
MyMakerBundle is a Symfony bundle for generating custom CRUDs (BackOffice, FrontOffice, User), WebProfiler Data Collectors, and Symfony bundle skeletons.
Installation
Install the bundle in your Symfony project (in development mode) via Composer:
composer require --dev aldaflux/my-maker-bundle
Configuration
To configure default output folders and route prefixes, you can create or edit config/packages/aldaflux_mymaker.yaml:
my_maker: backoffice: folder: controller: BackOffice template: backoffice route: name_prefix: admin_ path_prefix: admin frontoffice: folder: controller: Frontoffice template: frontoffice
Available Commands
1. BackOffice CRUD Generation (make:crud:admin)
Generates a complete administration CRUD (Controller, FormType, and Twig views) for a given Doctrine entity class.
php bin/console make:crud:admin EntityName
--with-voter option:
Adds security checks (is_granted) using Symfony Voters in the controller and Twig views.
php bin/console make:crud:admin EntityName --with-voter
Generated files:
src/Controller/BackOffice/EntityNameController.phpsrc/Form/EntityNameType.phptemplates/backoffice/entity_name/index.html.twigtemplates/backoffice/entity_name/show.html.twigtemplates/backoffice/entity_name/new.html.twigtemplates/backoffice/entity_name/edit.html.twigtemplates/backoffice/entity_name/_form.html.twigtemplates/backoffice/entity_name/_delete_form.html.twig
2. FrontOffice Views Generation (make:front:show)
Generates read-only views (list and details) and controller for the FrontOffice.
php bin/console make:front:show EntityName
Generated files:
src/Controller/Frontoffice/EntityNameController.phptemplates/frontoffice/entity_name/index.html.twigtemplates/frontoffice/entity_name/show.html.twig
3. User CRUD Generation (make:crud:user)
Generates a CRUD specifically designed for managing user accounts (password hashing, password change, roles management, user profile).
php bin/console make:crud:user
--with-voter option:
Adds voter security checks (is_granted('view', user), is_granted('edit', user), etc.) in views and controllers.
php bin/console make:crud:user --with-voter
4. Data Collector Generation (make:data:collector)
Generates a custom DataCollector for the Symfony WebProfiler, including its SVG icon and Twig template.
php bin/console make:data:collector CustomCollector
5. Symfony Bundle Generation (make:aldalflux:bundle)
Generates the directory tree and structure for a new full Symfony bundle (Configuration classes, DI Extension, composer.json, services.yml).
php bin/console make:aldalflux:bundle