agence-adeliom / sylius-easy-crud-plugin
Easy CRUD plugin for Sylius.
Package info
github.com/agence-adeliom/sylius-easy-crud-plugin
Type:sylius-plugin
pkg:composer/agence-adeliom/sylius-easy-crud-plugin
Requires
- php: ^8.4 || ^8.5
- ext-intl: *
- ext-json: *
- embed/embed: ^4.4
- sylius/sylius: ^2.3
- symfony/uid: ^7.4 || ^8.0
Requires (Dev)
- behat/behat: ^3.16 || ^4.0@alpha
- behat/mink: ^1.13
- dmore/behat-chrome-extension: ^1.4 || dev-main@dev
- dmore/chrome-mink-driver: ^2.9
- friends-of-behat/mink-browserkit-driver: ^1.6.3
- friends-of-behat/mink-debug-extension: ^2.1
- friends-of-behat/mink-extension: ^2.7 || ^3.0@alpha
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/symfony-extension: ^2.6
- friends-of-behat/variadic-extension: ^1.6
- friendsofsymfony/rest-bundle: ^3.7
- nyholm/psr7: ^1.8
- phpstan/phpstan: ^2.0
- phpstan/phpstan-doctrine: ^2.0
- phpstan/phpstan-webmozart-assert: ^2.0
- phpunit/phpunit: ^10.5
- robertfausk/behat-panther-extension: ^1.1 || ^2.0
- sylius-labs/coding-standard: ^4.4
- sylius-labs/suite-tags-extension: ~0.2
- sylius/sylius-mate-extension: ^0.9
- sylius/test-application: ^2.3.0@alpha
- symfony/browser-kit: ^7.4 || ^8.0
- symfony/debug-bundle: ^7.4 || ^8.0
- symfony/dotenv: ^7.4 || ^8.0
- symfony/http-client: ^7.4 || ^8.0
- symfony/intl: ^7.4 || ^8.0
- symfony/maker-bundle: ^1.67
- symfony/runtime: ^7.4 || ^8.0
- symfony/web-profiler-bundle: ^7.4 || ^8.0
- symfony/webpack-encore-bundle: ^2.2
Suggests
- sylius/sylius-mate-extension: Exposes the easy-crud resources to the Symfony AI Mate tools (easy_crud_list_admins, easy_crud_inspect_admin)
Provides
None
Conflicts
Replaces
None
- 2.x-dev
- v2.4.0
- 2.3.x-dev
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.3.0-alpha.1
- 2.1.x-dev
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-ALPHA-1
- 1.x-dev
- v1.14.6
- v1.14.5
- v1.14.4
- v1.14.3
- v1.14.2
- v1.14.1
- v1.14.0
- v1.13.19
- v1.13.18
- v1.13.17
- v1.13.16
- v1.13.15
- v1.13.14
- v1.13.13
- v1.13.12
- v1.13.11
- v1.13.10
- v1.13.9
- v1.13.8
- v1.13.7
- v1.13.6
- v1.13.5
- v1.13.4
- v1.13.3
- v1.13.2
- v1.13.1
- v1.13.0
- 0.x-dev
- dev-refactor/services-php
- dev-feat/collection-field
- dev-feat/sortable-collection-bootstrap-accordion
- dev-feat/position-sortable-field
- dev-fix/grid-assets-package
- dev-fix/show-iterable-objects
- dev-claude/symfony-8-compatibility-tgJgc
- dev-feature/ux-autocomplete
- dev-32-feat-migrate-to-sylius-stack
- dev-feature/test-application-plugin-migration
- dev-columns-rows
- dev-30-feature-request-move-autocomplete-method-to-a-trait
This package is auto-updated.
Last update: 2026-10-23 15:01:14 UTC
README
Sylius Easy CRUD Plugin
Overview • Installation • Quick Start • Documentation
Overview
Sylius Easy CRUD Plugin is an abstraction layer that helps building CRUD interfaces in Sylius e-commerce.
🧩 Define your entire CRUD interface (list, create, edit, show, delete) in a single configureFields() method on a App\Admin\ResourceAdmin class based on Sylius resources — similar to EasyAdminBundle, but integrated with Sylius!
🚀 With this Admin class this plugin generates automatically all CRUD interfaces for you: Grid, Creation/Edition forms, Show page, and preconfigured CRUD Actions. It also provides a rich set of form field types that helps you build forms with minimal code.
✨ Transform Symfony entities / Sylius resources into fully functional admin interfaces in minutes!
#[AsAdmin(resourceClass: Post::class)] final class PostAdmin extends AbstractAdmin { /** * @return iterable<FieldInterface> */ public function configureFields(string $pageName, ?string $context = null): iterable { yield TabField::new('tab1', 'Tab 1'); yield ColumnField::new('tab1_left') ->setSize(ColumnSizeEnum::WIDE_8_OF_12); yield TranslationField::new('translations') ->addField( Field::new('name') ->setDisabled(false) ->setRequired(true) ) ->onlyOnForms(); yield ColumnField::new('tab1_right') ->setSize(ColumnSizeEnum::WIDE_4_OF_12); yield IconField::new('icon') ->onlyOnForms(); yield CheckboxField::new('enabled'); ... } /** * @return iterable<FilterInterface> */ public function configureFilters(): iterable { yield BooleanFilter::create('enabled') ->setLabel('Enabled'); } public function configureActions(string $pageName): Actions { return parent::configureActions($pageName) ->remove(Crud::PAGE_EDIT, Action::DELETE); } }
What Makes It Easy?
- 🚀 Rapid Development: Generate complete CRUD interfaces in minutes with Symfony Maker commands
- 🎨 Rich Field Types: 18+ specialized fields (Image, WYSIWYG, CodeEditor, Slug, Sortable Collections, and more)
- 🌍 i18n Ready: Built-in translatable content mapped to Sylius Translation system
- 🧩 Highly Extensible: Custom field configurators, actions, and form types
- 😎 Centralized configuration: CRUD configuration in a single Admin class per resource
Why we built this plugin
In our previous Symfony projects we were familiar with EasyAdminBundle and developed several bundles based on it. When we migrated to Sylius, we looked for a fast and efficient way to reuse those bundles, so we tried to integrate the missing parts:
- The EasyAdmin abstraction layer to allow building forms, lists and show pages in a single Admin class.
- Our previous CMS features.
We have used this bundle in production on several projects and decided to share it with the community.
It does not fully comply (yet) with last Sylius guidelines, so please use this plugin with caution.
A duo: Easy CRUD + Happy CMS
Alongside this plugin, we migrated our other EasyAdmin-based bundles — which provided content management (CMS) features — into a separate plugin called Happy CMS. It is an alternative for building CMS features in Sylius.
Versions
| Plugin Version | Sylius | Php | Symfony |
|---|---|---|---|
| 1.13, 1.14 | 1.13, 1.14 | 8.2, 8.3, 8.4 | 6.4, 7.x |
| ^2.0.0 | ^2.0.0 | 8.2, 8.3, 8.4 | 6.4, 7.x |
| ^2.1.0 | ^2.1.0, ^2.2.0 | 8.3, 8.4, 8.5 | 6.4, 7.x |
| ^2.3.0 | ^2.3.0 | 8.4, 8.5 | 7.4, 8.x |
Upgrading? Read UPGRADE.md: 2.3.2 declares the resources with attributes (the YAML declaration is deprecated) and contains backward compatibility breaks for Admins overriding the constructor and custom controllers.
Installation
1. Install via Composer
composer require agence-adeliom/sylius-easy-crud-plugin composer require --dev symfony/maker-bundle
2. Enable the Bundle
Add the plugin to config/bundles.php:
<?php return [ // ... Adeliom\SyliusEasyCrudPlugin\SyliusEasyCrudPlugin::class => ['all' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true, 'test' => true], ];
3. Import Configuration
In config/packages/_sylius.yaml:
imports: - { resource: "@SyliusEasyCrudPlugin/config/config.yaml" }
4. Import Routes
In config/routes.yaml:
sylius_easy_crud: resource: "@SyliusEasyCrudPlugin/config/routes.yaml"
The plugin routes, and the routes of the resources declared with #[AsAdmin], are then served under the Sylius
admin path (/%sylius_admin.path_name%, /admin by default).
If your admin uses another prefix or its own host, import the unprefixed admin routes and the #[AsAdmin] routes
loader instead:
sylius_easy_crud_admin: resource: "@SyliusEasyCrudPlugin/config/routes/admin.yaml" prefix: /back-office # or no prefix at all host: '%admin_host%' # optional sylius_easy_crud_attributes: resource: 'Adeliom\SyliusEasyCrudPlugin\Routing\EasyCrudAttributesRoutesLoader' type: service prefix: /back-office host: '%admin_host%'
5. Declare the resources with attributes
Enable the discovery of the #[AsAdmin] Admin classes, and the native Sylius discovery of the #[AsResource] models:
# config/packages/sylius_easy_crud.yaml sylius_easy_crud: attributes: enabled: true # a boolean or a %parameter%, not an environment variable paths: ['%kernel.project_dir%/src/Admin'] # existing directories holding the #[AsAdmin] classes # config/packages/sylius_resource.yaml sylius_resource: mapping: paths: ['%kernel.project_dir%/src/Entity'] # where the #[AsResource] models live
Without it (enabled: false, the default), the resources are declared with the sylius_resource +
type: sylius.resource YAML blocks, which is deprecated: see UPGRADE.md to migrate.
6. Install Assets
php bin/console assets:install
Quick Start
Step 1: Generate an Entity
Create a new entity with translation support:
php bin/console make:easy-crud:create-entity Post php bin/console doc:mig:diff php bin/console doc:mig:mig
This generates:
src/Entity/Post.phpsrc/Entity/PostTranslation.phpsrc/Repository/PostRepository.php
Step 2: Generate the CRUD
Create a complete CRUD interface for your entity:
php bin/console make:easy-crud:create-crud Post
This generates:
src/Admin/PostAdmin.php- CRUD configuration class, with#[AsAdmin]- Updates
src/Entity/Post.php- Adds#[AsResource] - Updates
src/Menu/AdminMenuListener.php- Adds menu entry
With sylius_easy_crud.attributes.enabled: false, it updates config/routes.yaml and
config/packages/sylius_resource.yaml instead of adding the attributes (deprecated).
Step 3: Configure Your CRUD
Edit src/Admin/PostAdmin.php:
Configure your fields in the configureFields() or your filters with configureFilters() method.
Step 4: Access Your CRUD
Navigate to your Sylius admin panel and find your new "Posts" menu entry. You now have a fully functional CRUD interface!
Documentation
📚 User Guides
If this plugin helped you, please consider giving it a ⭐ on GitHub!
Made with ❤️ by Adeliom

