majerome / sylius-workshop-plugin
Majerome workshop plugin for Sylius.
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:sylius-plugin
Requires
- php: ^8.1
- sylius/sylius: ~1.13.0
- symfony/webpack-encore-bundle: ^1.15
Requires (Dev)
- behat/behat: ^3.6.1
- behat/mink-selenium2-driver: ^1.4
- dbrekelmans/bdi: ^1.1
- dmore/behat-chrome-extension: ^1.3
- dmore/chrome-mink-driver: ^2.7
- friends-of-behat/mink: ^1.8
- friends-of-behat/mink-browserkit-driver: ^1.4
- friends-of-behat/mink-debug-extension: ^2.0.0
- friends-of-behat/mink-extension: ^2.4
- friends-of-behat/page-object-extension: ^0.3
- friends-of-behat/suite-settings-extension: ^1.0
- friends-of-behat/symfony-extension: ^2.1
- friends-of-behat/variadic-extension: ^1.3
- phpspec/phpspec: ^7.2
- phpstan/extension-installer: ^1.0
- phpstan/phpstan: ^1.8.1
- phpstan/phpstan-doctrine: 1.3.69
- phpstan/phpstan-strict-rules: ^1.3.0
- phpstan/phpstan-webmozart-assert: ^1.2.0
- phpunit/phpunit: ^10.5
- polishsymfonycommunity/symfony-mocker-container: ^1.0
- robertfausk/behat-panther-extension: ^1.1
- sylius-labs/coding-standard: ^4.2
- sylius-labs/suite-tags-extension: ^0.2
- symfony/browser-kit: ^5.4 || ^6.4
- symfony/debug-bundle: ^5.4 || ^6.4
- symfony/dotenv: ^5.4 || ^6.4
- symfony/flex: ^2.4
- symfony/intl: ^5.4 || ^6.4
- symfony/web-profiler-bundle: ^5.4 || ^6.4
Conflicts
- symfony/framework-bundle: 6.2.8
README
Sylius Practical Mastery Course
Chapter 25.2 - How to create a Plugin
This plugin is the product of Sylius training. It allows you to add a custom “Brand” resource, with those features :
- Back Office Grid: creation, edition, deletion,
- Assignment to a category "automotive" or "electronics.",
- Workflow for brand validation by State Machine,
- Association brands-products, and listing of branded products.
Installation (Docker)
Note: Only tested on a Sylius v1.13 Docker Project
-
Add the plugin to your
composer.json
file:docker compose exec php composer require majerome/sylius-workshop-plugin
-
Apply the git patch to set up the plugin:
git apply vendor/majerome/sylius-workshop-plugin/src/Installer/majerome-workshop-plugin-sylius-1.13.patch
Note: You can revert that patch using majerome-workshop-plugin-sylius-1.13-revert.patch file instead
-
Get into the php container and flush the cache:
make php-shell
Then run:
bin/console cache:clear
-
Generate the migrations:
bin/console doctrine:migrations:diff
Note: Choose namespace
[0] App\Migrations
. -
Run the migration
bin/console doctrine:migrations:execute --up "App\\Migrations\\VersionYYYYMMDDHHMMSSS"
Note: Replace YYYYMMDDHHMMSSS with the actual timestamp of the migration.
-
Load the fixtures:
bin/console sylius:fixtures:load -n
-
Play with your new Brand resource!